-
-
\ No newline at end of file
diff --git a/.idea/splunk-sdk-java.iml b/.idea/splunk-sdk-java.iml
deleted file mode 100644
index d6ebd480..00000000
--- a/.idea/splunk-sdk-java.iml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
deleted file mode 100644
index 3b000203..00000000
--- a/.idea/uiDesigner.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 9d32e507..00000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/.project b/.project
deleted file mode 100644
index 74abb713..00000000
--- a/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- splunk-sdk-java
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
-
-
diff --git a/ApplicationTestWithoutSetup/ApplicationTestWithoutSetup.iml b/ApplicationTestWithoutSetup/ApplicationTestWithoutSetup.iml
deleted file mode 100644
index d5c07432..00000000
--- a/ApplicationTestWithoutSetup/ApplicationTestWithoutSetup.iml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 8aad9ae9..00000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,678 +0,0 @@
-# Splunk Enterprise SDK for Java Changelog
-
-## Version 1.9.5
-
-### New Features and APIs
-* Added static method _addClusterMasterURIsToHosts_ in HttpService class to update list of Valid Hosts with Cluster Master Hosts (GitHub PR [#215](https://github.com/splunk/splunk-sdk-java/pull/215))
-* Added instance method _getClusterMasters_ in Service class to get list of cluster master hosts
-
-## Version 1.9.4
-
-### Minor Changes
-* Added check for localhost IPv6 address, for IPv6 compatible apps (GitHub PR [#210](https://github.com/splunk/splunk-sdk-java/pull/210))
-* Updating SSL_SOCKET_FACTORY instance on changing _validateCertificates_ flag. (GitHub PR [#206](https://github.com/splunk/splunk-sdk-java/pull/210))
-
-## Version 1.9.3
-
-### Minor Changes
-* Re-fetch logic for instancetype and version fields if not set within Service instance to avoid NPE (GitHub PR [#202](https://github.com/splunk/splunk-sdk-java/pull/202))
-* Check for local IP as alternative to _localhost_ within HostnameVerifier, addressing issue with certain local workflows
-
-## Version 1.9.2
-
-### New Features and APIs
-* Added feature that allows to update ACL properties of an entity (GitHub PR [#196](https://github.com/splunk/splunk-sdk-java/pull/196))
-
-### Minor Changes
-* Added null check for child to handle error when no value is passed for a parameter in modular-inputs (Ref issue [#198](https://github.com/splunk/splunk-sdk-java/issues/198) & GitHub PR [#199](https://github.com/splunk/splunk-sdk-java/pull/199))
-
-## Version 1.9.1
-
-### New Features and APIs
-* SDK Support for third-party (Load Balancer) "sticky sessions"(cookie persistence) (Github PR [#192](https://github.com/splunk/splunk-sdk-java/pull/192))
-* Added Args option for Saved Search history method (GitHub Issue [#126](https://github.com/splunk/splunk-sdk-java/issues/126) & PR [#188](https://github.com/splunk/splunk-sdk-java/pull/188) )
-
-### Minor Changes
-* Special handling related to the semantic versioning of specific Search APIs functional in Splunk Enterprise 9.0.2 and (Splunk Cloud 9.0.2209). These SDK changes will enable seamless transition between the APIs based on the version of the Splunk Enterprise/Cloud (Github PR [#193](https://github.com/splunk/splunk-sdk-java/pull/193))
-* Updated checks to fetch Storage Passwords with wildcards in namespace. (GitHub PR [#187](https://github.com/splunk/splunk-sdk-java/pull/187))
-
-## Version 1.9.0
-
-### New Features and APIs
-* SDK Support for splunkd search API changes, for Splunk 9.0+. (Github PR [#189](https://github.com/splunk/splunk-sdk-java/pull/189))
-
-### Minor Changes
-* Automated docs generation using GitHub actions. (Github PR [#184](https://github.com/splunk/splunk-sdk-java/pull/184))
-
-## Version 1.8.0
-
-### New Features and APIs
-* Added a support to add custom headers in Service class. (Github PR [#176](https://github.com/splunk/splunk-sdk-java/pull/176)).
-* SSL Certificate validation (default implementation) added. (Github PR [#175](https://github.com/splunk/splunk-sdk-java/pull/175)).
- * Boolean flag is introduced to skip/validate certificate. Use _HttpService.setValidateCertificates()_ to enable/disable certificate validation.
- * Breaking change: Certificate validation is now enforced by default, for local or non-production use cases use _HttpService.setValidateCertificates(false)_.
-* Apps/app-install replaced with **apps/local**. (Github PR [#168](https://github.com/splunk/splunk-sdk-java/pull/168))
-* Breaking change: HttpService.useTLS flag removed, please use _HttpService.setSslSecurityProtocol()_ to set a specific SSL/TLS implementation or else TLS v1.2 is used by default for Java 1.8.
-
-### Minor Changes
-
-* External Entities restricted in XML factory. (Github PR [#180](https://github.com/splunk/splunk-sdk-java/pull/180)).
- * Prevent expansion of external entities in Document Builder factory.
-* Headers modified in Socket creation. (Github PR [#179](https://github.com/splunk/splunk-sdk-java/pull/179)).
- * Http Request uses raw request headers by including escape characters which seems vulnerable. It was replaced with PrintWriter methods to avoid escape characters.
- * Host parameter used in Socket is omitted to prevent exposing it to external users.
-* README.md file modified with all login methods along with Splunk Search creation example. (Github PR [#177](https://github.com/splunk/splunk-sdk-java/pull/177)).
-* Deploy plugin is removed from Splunk module pom to avoid redundancy. (Github PR [#172](https://github.com/splunk/splunk-sdk-java/pull/172)).
-* Setter methods for Session and Bearer token added along with test case. (Github PR [#171](https://github.com/splunk/splunk-sdk-java/pull/171))
- * **Use:** service.setSplunkToken() for session tokens and service.setBearerToken() for long-lived tokens.
-* Modular input folder name renamed based on newer splunk folder name validation. (Github PR [#168](https://github.com/splunk/splunk-sdk-java/pull/168))
-* SDK app collection URL has been updated to v1.1.0 in docker compose file. (Github PR [#168](https://github.com/splunk/splunk-sdk-java/pull/168))
- * Test files in sdk app collections are modified based on python v3 syntax.
-* Added Saved Search test case based on title. (Github PR [#166](https://github.com/splunk/splunk-sdk-java/pull/166))
-
-## Version 1.7.1
-
-### Minor Changes
-* Dependency breaking changes are resolved.
-
-## Version 1.7.0
-
-### New Features and APIs
-* Added Credits.md file along with licences. (Github PR [#162](https://github.com/splunk/splunk-sdk-java/pull/162)).
-* Improved TLS implementation as default behavior and turned on hostname verification for all hosts. (Github PR [#158](https://github.com/splunk/splunk-sdk-java/pull/158)).
-
-### Minor changes
-* Replaced Travis CI with Github actions (Github PR [#161](https://github.com/splunk/splunk-sdk-java/pull/161)).
-* Fixed Javadoc generation while project packaging. (Github PR [#159](https://github.com/splunk/splunk-sdk-java/pull/159)).
-* Fixed breaking change of **Index.getMaxHotBuckets()** method behavior to return as String instead of int.
-* SDK build is migrated from ant build tool to maven build tool (Github PR [#157](https://github.com/splunk/splunk-sdk-java/pull/157)).
- * Dependencies directory for ant build is removed and maven dependencies are added using pom.xml.
- * Dependencies are upgraded to its LTS version.
- * Project structure is re-organized with respect to Maven.
-
-## Version 1.6.5
-
-### Bug Fixes
-
-* Fixed bug for push back buffer is full when exporting data in XML (GitHub PR [#125](https://github.com/splunk/splunk-sdk-java/pull/125)).
-
-## Version 1.6.4
-
-### Bug Fixes
-
-* Fixed bug in modinput Windows shims that caused Splunk Enterprise to fail to restart (GitHub PR [#120](https://github.com/splunk/splunk-sdk-java/pull/120)).
-* Fixed bug with data model endpoint on Splunk Enterprise 7+ (GitHub PR [#117](https://github.com/splunk/splunk-sdk-java/pull/117)).
-* Fixed bug with invalid `Index.submit()` forming an invalid REST API path for namespaced services ([#118](https://github.com/splunk/splunk-sdk-java/pull/118)).
-* Fixed bug with `Value.toDate(string value)` not being thread safe (GitHub PR [#109](https://github.com/splunk/splunk-sdk-java/pull/109)).
-
-## Version 1.6.3
-
-### New features and APIs
-
-* Added the `updated` property on all `Resource` objects (GitHub PR [#104](https://github.com/splunk/splunk-sdk-java/pull/104)).
-
-## Version 1.6.2
-
-### Bug Fixes
-
-* Update modular input shims to ensure Java processes are killed (GitHub issue [#92](https://github.com/splunk/splunk-sdk-java/issues/92)).
-
-## Version 1.6.1
-
-### Bug Fixes
-
-* Fix authentication issues when the Splunk `Set-Cookie` header is not the first one.
-
-## Version 1.6.0
-
-### New features and APIs
-
-* Added support for retrieving `Password` entities scoped by realm and username.
-* Added getter methods for embed `SavedSearch` properties.
-* Added support for custom `HttpURLConnection` connection timeouts on `HttpService`.
-* Performance improvement to `SavedSearch.dispatch()`.
-* Added getter methods to the `Job` class for retrieving `long` values (`getEventCountLong`, `getResultCountLong`, `getScanCountLong`).
-* Added `setFieldList()` to the `JobExportArgs` class.
-* Added support for the `manualRebuilds` `DataModel` setting.
-
-### Bug Fixes
-
-* Fixed `SavedSearch.Dispatch()` throwing a `NullPointerException` in some load-balanced search head clustering environments.
-* Fixed non-limit `PivotFilter` constructing the wrong JSON blob.
-
-### Minor changes
-
-* Added support for Travis CI.
-
-## Version 1.5.0
-
-### New features and APIs
-
-* Added support for cookie-based authentication, for Splunk 6.2+.
-
-### Bug Fixes
-
-* Fixed failure parsing XML responses. Pull Request #76.
-* Fixed bug where `Job` is never ready leading to infinite loops.
-
-### Minor changes
-
-* The SDK is now properly compiled with the `Command` class used in examples.
-
-## Version 1.4.0
-
-### New features and APIs
-
-* Added support for Java 8, when manually configuring the `Service` class to use TLSv1.2, TLSv1.1, or TLSv1 defined in the `SSLSecurityProtocol` enum. The default is still SSLv3.
-* Allow setting a custom `SSLSocketFactory` on the `HTTPService` and `Service` classes.
-
-### New examples
-
-* `ssl_protocols`: tries to connect to Splunk over HTTPS using different SSL/TLS protocols, then using a custom SSL and TLS `SSLSocketFactory`.
-
-### Minor changes
-
-* The SDK is now compiled with the `Command` class used in examples.
-
-## Version 1.3.2
-
-### Performance improvements
-
-* `Job` objects will only be refreshed by `isReady()` if the `Job` is not ready. This minimizes HTTP requests when getting properties of the `Job`.
-* The `Service` class now has a `getJob()` method that is used to retrieve a `Job` object by its sid String. This is better than calling `service.getJobs().get(sid)`, which has the overhead of getting all `Job` objects from Splunk in order to access a single `Job`.
-
-### New examples
-
-* `endpoint_instantiation`: shows how to manually instantiate any Splunk REST API endpoint.
-* `get_job`: shows how to get a `Job` by its sid using the new `Service.getJob()` method.
-
-### Minor changes
-
-* The `Entity` and `EntityCollection` classes each have a public constructor, so any Splunk endpoint can be manually instantiated.
-* The `FiredAlert` class now has a `getParsedExpirationTime()` method that returns a `Date` object.
-* Some test have been modified to work with the latest release of Splunk Enterprise (6.2.x).
-
-## Version 1.3.1
-
-* Removed deprecated functions from `DistributedConfiguration` class.
-* Oneshot searches, called from `Index.upload`, can now be passed search arguments.
-* Fixed a resource leak in the `Command.load` function.
-
-## Version 1.3
-
-### New features and APIs
-
-* Added support for data models and pivots.
-
-### Bug Fixes
-
-* When setting the sourcetype of a modular input event, events are indexed properly.
- Previously Splunk would encounter an error and skip them. Also updated some of the modular input test data to reflect this change.
-* ResultsReaderXml now works with alternate XML parser libraries.
-
-## Version 1.2.2
-
-### Bug fixes
-
-* Hot fix to ResultsReaderXml to work with woodstox XML parsing library.
-
-## Version 1.2.1
-
-### New features and APIs
-
-* The Splunk Enterprise SDK for Java is fully compatible with Splunk Enterprise 6.0 as of this release.
-
-### Bug fixes
-
-* **JobCollection.create()** previously invalidated the collection and refreshed it to see whether the job had
- appeared. This was problematic for Splunk Enterprise instances running many jobs at once. The method has been changed
- to only interact with the endpoint specific to the newly created job.
-* Namespaces that contain special characters such as '@' in their owner or app are now handled correctly.
-
-### Breaking changes
-
-* Removed **Application.isManageable** and **Application.setManageable**, since they are deprecated or nonexistent
- in all supported Splunk versions as of this release.
-* **OutputDefault.getMaxQueueSize** now returns a String instead of a long to match the behavior of
- **setMaxQueueSize**.
-
-### Known issues
-
-* Certain combinations of requests and restarts of splunkd can cause splunkd to hang on OS X v10.8 Mountain Lion and
- OS X v10.9 Mavericks running Splunk 6.0.0. This issue is not present when running Splunk Enterprise on earlier
- versions of OS X. This will be fixed in a future release.
-
-* The modular input support in the Splunk Enterprise SDK for Java is not compatible with Windows Server 2003 or Windows Server
- 2003 R2.
-
-## Version 1.2
-
-### New features and APIs
-
-* Added support for building modular input scripts in Java using the Splunk Enterprise SDK for Java.
-
-### Bug fixes
-
-* Any errors returned by Splunk in formats besides XML (for example, when Splunk returns JSON
- if an error occurs during a search with output_mode=json), are passed on as is in the resulting
- HttpException, replacing the uninformative error about XML parsing that was produced before.
-
-## Version 1.1
-
-### Breaking changes
-
-* The default setting for all search jobs is now `segmentation=none` unless
- you explicitly set it otherwise. This setting returns results as a raw-text
- string rather than a string in XML format.
-
-* The `ResultReaderCsv` class no longer supports streams from the `Service.export` method.
- Instead, use the `ResultReaderXml` class with XML output, or use the `ResultReaderJson`
- class with JSON output.
-
-### New features and APIs
-
-* New classes have been added, `MultiResultsReaderXml` and `MultiResultsReaderJson`,
- to read search results streams with multiple result sets from `Service.Export` methods.
-
-* The `ResultsReader` classes now support `Iterable` and `Iterator` interfaces.
-
-* The `Event.getSegmentedRaw` method has been added to return raw data from events, preserving
- segmentation information.
-
-### Bug fixes
-
-* The `ServiceInfo` class now uses the `services/*` endpoint rather than the
- default namespace (`servicesNS/*`) for HTTP requests. This change is a workaround to
- avoid a bug in Splunk that returns HTTP code 403 when the `server/info` endpoint
- is accessed using certain namespaces.
-
-* The `ResultsReaderXml` class can now read search results streams from the
- `Job.getResultsPreview` method.
-
-## Version 1.0
-
-### New features and APIs
-
-* Specialized *args* classes have been added to make it easier to pass
- entity-specific arguments:
- - `CollectionArgs`
- - `IndexCollectionArgs`
- - `JobArgs`
- - `JobEventsArgs`
- - `JobExportArgs`
- - `JobResultsArgs`
- - `JobResultsPreviewArgs`
- - `JobSummaryArgs`
- - `SavedSearchCollectionArgs`
- - `SavedSearchDispatchArgs`
-
- These new *args* classes are used with the following methods:
- - `Service` constructor
- - `Service.getSavedSearches` method
- - `Service.getJobs` method
- - `Service.getIndexes` method
- - `Service.export` method
- - `JobCollection.create` method
- - `Job.getResults` method
- - `Job.getResultsPreview` method
- - `Job.getEvents` method
- - `Job.getSummary` method
- - `SavedSearch.dispatch` method
-
-* `ResultsReader.getNextEvent` now returns an `Event` object, which provides
- better handling for multi-value fields. This change is backward-compatible
- with older code that expects a `HashMap`. However this new
- `Event` object is read-only.
-
-* Modular input functionality has been implemented (requiring Splunk 5.0+)
- and the following classes have been added:
- - `ModularInputKind`
- - `ModularInputKindArgument`
-
- The `InputCollection` class also now handles arbitrary input kinds represented
- by modular inputs. You can call `InputCollection.getInputKinds` to get the set
- of `InputKinds` on the connected Splunk instance.
-
-* The `ReceiverBehavior` interface has been added to work with output streams.
-
-* The `IndexCollection` class has been added as a specialized collection class
- for indexes.
-
-* The `JobCollection` class has been added as a specialized collection class for
- jobs.
-
-* You can now programatically remove indexes using the `IndexCollection.remove`
- method (requires Splunk 5.0+).
-
-* You can now send data to an input using the `TcpInputs.attach`,
- `TcpInputs.submit`, and `UdpInput.submit` convenience methods.
-
-* You can now restrict inputs to a specified host using the `setRestrictToHost`
- method on `TcpInput`, `TcpSplunkInput`, and `UdpInput` (this method requires
- Splunk 5.0+).
-
-* The `DistributedConfiguration.enable` and `DistributedConfiguration.disable`
- convenience methods have been added, allowing you to immediately enable or
- disable the configuration.
-
-* The following methods have been added to the `Index` class:
- - `getBucketRebuildMemoryHint`
- - `getMaxTimeUnreplicatedNoAcks`
- - `getMaxTimeUnreplicatedWithAcks`
- - `setBucketRebuildMemoryHint`
- - `setMaxTimeUnreplicatedNoAcks`
- - `setMaxTimeUnreplicatedWithAcks`
-
-### Breaking changes
-
-* The JAR files have changed so that everything is now included in the
- **splunk.jar** file. The **splunk-external.jar** and **splunk-sdk.jar** files
- have been removed.
-
-* Arguments are now submitted to Splunk in a consistent order, which improves
- behavior in certain cases.
-
-* The `InputKind` enum is now a class. The `InputKind` class has static members
- identical to the enum values, but you can no longer use a `switch` statement
- over the values. Instead, use a series of `if-else` blocks. This change was
- necessary to support arbitrary modular input kinds.
-
-* All text is now consistently UTF-8 encoded. Previously, the platform-native
- encoding was used in certain cases. For example:
- - HTTP requests are sent in UTF-8. In particular the values of *args*
- classes are always encoded in UTF-8.
- - Results and events from jobs are read as UTF-8.
-
-* The `Index.setAssureUTF8` method fails for Splunk 5.0+ because this field has
- become a global setting rather than a per-index setting.
-
-* The `Index.clean` method now throws `SplunkException.INTERRUPTED` when
- interrupted. Additionally, the `maxSeconds` parameter is obeyed more
- accurately.
-
-* The `WindowsRegistryInput.getType` and `WindowsRegistryInput.setType` method
- type has changed to `String[]` instead of `String`.
-
-* The `DistributedPeer.getBuild` method now returns an `int` instead of a
- `String` to be consistent with the `ServiceInfo.getBuild` method.
-
-* The `setRestrictToHost` method on `TcpInput`, `TcpSplunkInput`, and `UdpInput`
- throws an exception for Splunk 4.x. Previously, this method failed silently.
-
-* The `StormService` class has been removed, but will be restored in a
- subsequent release.
-
-* The methods in the `ResultsReader` class now throw `IOException` instead of a
- plain `Exception`, so callers no longer need to handle a plain `Exception`.
-
-* The `SplunkException` class now provides error messages when printed.
-
-* The test suite has been completely cleaned up, resulting in better coverage
- and faster performance, mostly by eliminating unnecessary restarts. The test
- suite strictly requires tests to handle restart requests.
-
-* The `get`, `remove`, and `contains` methods for entity collections now throw
- an exception when a wildcarded namespace is passed, rather than incorrectly
- returning an empty list or taking no action.
-
-* The `HashMap` and `Event` objects returned by `ResultsReader.getNextEvent` are
- now read-only.
-
-* The `SavedSearch.getDispatchMaxTime` method previously returned a `String`,
- but now returns an `int`.
-
-* The `LicensePool.getSlavesUsageBytes` method now returns a map from each slave
- GUID to its license usage, instead of returning a `long`.
-
-* The `Service.oneshot` method has been renamed to `Service.oneshotSearch`.
-
-* The `Service.oneshot(String query, Map inputArgs, Map outputArgs)` overload
- has been removed, because `outputArgs` had no effect.
-
-* The `SavedSearch.setArgsWildcard` method has been removed. To set a wildcard
- parameter, specify it as a key-value pair in a map and pass it to the
- `SavedSearch.dispatch(java.util.Map args)` method.
-
-* The `SavedSearch.setActionWildcard` method has been removed. Use the specific
- setters to update these parameters.
-
-* The `SavedSearch.setDispatchWildcard` method has been removed. Use the
- specific setters to update these parameters.
-
-* The `Service.getFiredAlerts` method has been renamed to
- `getFiredAlertsGroups`.
-
-* The `Entity.reload` method has been removed.
-
-* The `Entity.toUpdate` field is no longer public.
-
-* The `Service.search(query)` and `Service.search(query, args)` methods now
- return a search job instead of blocking and returning results.
-
-* The `Service.search(query, inputArgs, outputArgs)` overload has been removed.
-
-* The `OutputServer.setsslRootCAPPath` method has been renamed to
- `setSslRootCAPPath`.
-
-* The `SavedSearch.getDispatchReduceFreq` method, which returned a `String`, has
- been replaced with `getDispatchReduceFrequency`, which returns an `int`.
-
-* The `setRestrictToHost` method has been removed from the `TcpInput` and
- `UdpInput` classes.
-
-* The `Settings.setMgmtHostPort` method has been renamed to `setMgmtPort` and
- this method now returns an `int`.
-
-### Bug fixes
-
-* The `Service.versionCompare` method has been fixed to work as expected.
-
-* The `OutputDefault.update` method has been fixed so that when a "name"
- parameter is not specified, the method no longer fails.
-
-### Deprecated features
-
-The following list contains the main features that have been deprecated (trivial
-changes are not included):
-
-* The public fields in the `ServiceArgs` class have been deprecated in favor of
- the new setter methods to maintain consistency with the new *args* subclasses.
-
-* The `Application.isManageable` and `Application.setManageable` methods have
- been deprecated in Splunk 5.0 and later.
-
-* The `DistributedConfiguration.getServerTimeout` method has been deprecated in
- Splunk 5.0 and later.
-
-
-## Version 0.8.0 (beta)
-
-### Breaking changes
-
-* Changed how isDone() behaves with respect to job creation. Previously if a job
- was not ready on the server, calling job.isDone() would cause an exception.
- Now, calling isDone() will return false under the two following conditions:
- 1) The job has not yet been scheduled. 2) The job has been scheduled but the
- results are not ready. In addition, isDone() implicitly invokes job.refresh()
- so the caller does not need to. This simplifies the code waiting for a job
- result to this: (with a 500 millisecond polling interval)
-
- ```
- while (!job.isDone()) {
- sleep(500);
- }
- ```
-
-* Added isReady() method to the Job class. This method detects whether or
- not the job is ready to return data (i.e. be queried). It also implicitly
- invokes job.refresh(). This allows for jobs with previews but that have not
- necessarily completed to be accessed: (with a 500 millisecond polling
- interval)
-
- ```
- while (!job.isReady()) {
- sleep(500);
- }
- ```
-
-* All Job class accessors will call refresh once before accessing the object.
-
-### Bug fixes
-
-* Fixed ordering of collections when using pagination. Previously the order
- could be random. Now it maintains the order of the entities returned by the
- server.
-
-* Fixed XML streaming reader to properly work with paginated result sets.
-
-* Large collections can cause a default JVM to run out of memory: The Atom
- parsing uses the streaming XML parser as opposed to a DOM parser.
-
-* Fixed Index class getSync() method to return an integer instead of a boolean.
-
-* Added Index class get method getEnableOnlineBucketRepair().
-
-* Added Index class get method getMaxBloomBackfillBucketAge().
-
-## Version 0.5.0 (preview)
-
-### New APIs
-* `StormService` class
-* `Receiver` class
-* `Upload` class
-* New setter methods for all classes
-* New getter methods for various classes
-
-### New features
-* Added support for a default index, allowing optional parameters
- for streaming connections. The `Index` class now uses the new `Receiver`
- class.
-
-* Added a paginate feature for Splunk return data. This feature allows for
- `count` and `offset` methods to page through Splunk meta data instead of
- retrieving all the data at once:
-
- ```
- ConfCollection confs;
- Args args = new Args();
- args.put("count", 30);
- args.put("offset", 0);
-
- confs = service.getConfs(args);
- // ... operate on the first 30 elements
- offset = offset + 30;
- args.put("offset", offset)
- confs = service.getConfs(args);
- // ... operate on the next 30 elements
- ```
-
-* Added a namespacing feature as optional arguments (`app`, `owner`, `sharing`)
- to the collection's `create` and `get` methods. For more information about
- namespaces, see
- ["Overview of the Splunk Enterprise SDK for Java"](http://dev.splunk.com/view/java-sdk/SP-CAAAECN)
- on the Developer Portal.
-
- The following example shows how to use the optional namespace to restrict
- creating and selecting saved searches to the namespace "owner = magilicuddy,
- app = oneMeanApp":
-
- ```
- String searchName = "My scoped search";
- String search = "index=main * | head 10";
- args args = new Args();
- args.put("owner", "magilicuddy");
- args.put("app", "oneMeanApp");
-
- // ... other creation arguments also get set into the args map
-
- savedSearches.create(searchName, search, args);
- ```
-
- This example shows how to returns all saved searches within the same scoped
- namespace:
-
- ```
- args args = new Args();
- args.put("owner", "magilicuddy");
- args.put("app", "oneMeanApp");
- SavedSearchCollection
- mySavedSearches = service.getSavedSearches(args);
- ```
-
-* Added an XML, JSON, and CSV streaming results reader. This feature allows you
- to retrieve event data using an incremental streaming mechanism. Return data
- is in key-value pairs. The XML form uses built-in JDK XML parsing support. The
- JSON and CSV form requires third-party JSON and CSV tokenizers, which are
- included as ancillary .jar files in the SDK. The JSON and CSV streaming
- results reader, which requires the external tokenizers, are contained in a
- separate Splunk .jar file named `splunk-external.jar`.
-
- The following example uses the built-in XML streaming reader:
-
- ```
- Job job = service.getJobs().create(query, queryArgs);
- ...
-
- HashMap map;
- stream = job.getResults(outputArgs);
- ResultsReader resultsReader = new ResultsReaderXml(stream);
- while ((map = resultsReader.getNextEvent()) != null) {
- for (String key: map.keySet())
- System.out.println(key + " --> " + map.get(key));
- }
- ```
-
-* Added support for Splunk Storm. Instead of connecting to `Service`, you
- connect to the new `StormService` class using similar arguments. Then, get a
- `Receiver` object and log events. `StormService` requires the `index` key and
- `sourcetype` parameters when sending events:
-
- ```
- // the storm token provided by Splunk
- Args loginArgs = new Args("StormToken",
- "p-n8SwuWEqPlyOXdDU4PjxavFdAn1CnJea9LirgTvzmIhMEBys6w7UJUCtxp_7g7Q9XopR5dW0w=");
- Storm service = StormService.connect(loginArgs);
-
- // get the receiver object
- Receiver receiver = service.getReceiver();
-
- // index and source type are required for storm event submission
- Args logArgs = new Args();
- logArgs.put("index", "0e8a2df0834211e1a6fe123139335741");
- logArgs.put("sourcetype", "yoursourcetype");
-
- // log an event.
- receiver.log("This is a test event from the SDK", logArgs);
- ```
-
-### Minor additions
-
-* Added a `genevents` example to generate events and push into Splunk using
- various methods.
-* Added a second time format when parsing time. A second time format is required
- to accommodate the `data/input/oneshot` endpoint that does not return a
- standard time format and does not allow a time-format specifier.
-* Added a streaming reader to search examples. The main search example `search`
- shows how to use all three result readers. There are build
- modifications in build.xml to include the ancillary .jar files for JSON and
- CSV.
-* Added an `Input` example to display Splunk inputs and their attributes.
-* Added an alias `log` for `submit` to the `Receiver` class.
-* Updated eclipse .classpath file, accounting for new additions.
-
-### Bug fixes
-
-* Fixed argument processing in the tail example.
-* Fixed timing window during search job creation; added `JOB_NOT_READY`
- exception.
-* Fixed `Index` cleaning to require a timeout value; added `TIMEOUT` exception.
-* Fixed `LicensePool` type to use string quota instead of integer. This change
- allows for `MAX` and `[M|G|T]`.
-* Fixed `action` when trying to update `Settings`.
-* Fixed user creation to force lowercase usernames.
-* Fixed the missing get methods for `ServiceInfo`.
-* Fixed a number of getter methods.
-
-## Version 0.1.0 (preview)
-
-Initial Splunk Enterprise SDK for Java release.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644
index 26b75753..00000000
--- a/CONTRIBUTING.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Contributing Guidelines
-
-## How to contribute
-
-If you would like to contribute to this project, see [Contributions to Splunk](https://www.splunk.com/en_us/form/contributions.html) for more information.
-
-## Issues and bug reports
-
-If you're seeing some unexpected behavior with this project, please create an [issue](https://github.com/splunk/splunk-sdk-java/issues) on GitHub with the following information:
-
-1. Version of this project you're using (ex: 1.4.0)
-2. Platform version (ex: Windows Server 2012)
-3. Framework version (ex: Java 8)
-4. Splunk Enterprise version (ex: 8.0)
-5. Other relevant information (ex: local/remote environment, Splunk network configuration, standalone or distributed deployment, are load balancers used)
-
-Alternatively, if you have a Splunk question please ask on [Splunk Answers](https://community.splunk.com/t5/Splunk-Development/ct-p/developer-tools).
-
-## Pull requests
-
-We love to see pull requests!
-
-To create a pull request:
-
-1. Fill out the [Individual Contributor Agreement](https://www.splunk.com/en_us/form/contributions.html).
-2. Fork the [repository](https://github.com/splunk/splunk-sdk-java).
-3. Make changes to the **develop** branch, preferably with tests.
-4. Create a [pull request](https://github.com/splunk/splunk-sdk-java/pulls) against the **develop** branch.
-
-## Contact us
-
-If you have a paid Splunk Enterprise or Splunk Cloud license, you can contact [Support](https://www.splunk.com/en_us/support-and-services.html) with questions.
-
-You can reach the Splunk Developer Platform team at _devinfo@splunk.com_.
-
diff --git a/CREDITS.md b/CREDITS.md
deleted file mode 100644
index 9afabf92..00000000
--- a/CREDITS.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Third-party software credits
-
-Some of the components included in the Splunk Enterprise SDK for Java are licensed under free or open source licenses. We wish to thank the contributors to those projects.
-
-| Contributor | Description | License |
-|:----------- |:----------- |:------- |
-| [opencsv](https://sourceforge.net/p/opencsv/source/ci/master/tree/) | For reading and writing CSV in Java | [Apache](https://github.com/splunk/splunk-sdk-java/blob/master/licenses/LICENSE-OPENCSV) |
-| [commons-cli](https://github.com/apache/commons-cli) | A package of Java utility classes for the classes that are in java.lang's hierarchy | [Apache](https://github.com/splunk/splunk-sdk-java/blob/master/licenses/LICENSE-COMMONS) |
-| [gson](https://github.com/google/gson) | Convert Java Objects into their JSON representation | [Apache](https://github.com/splunk/splunk-sdk-java/blob/master/licenses/LICENSE-GSON) |
-| [junit](https://github.com/junit-team/junit4) | Unit testing framework for Java | [Eclipse](https://github.com/splunk/splunk-sdk-java/blob/master/licenses/LICENSE-JUNIT) |
-| [jacoco](https://github.com/jacoco/jacoco) | JaCoCo runtime agent to your tests and allows basic report creation. | [Eclipse](https://github.com/splunk/splunk-sdk-java/blob/master/licenses/LICENSE-JACOCO) |
-| [netbeans-api](https://github.com/apache/netbeans) | OpenIDE Utilities | [Apache](https://github.com/splunk/splunk-sdk-java/blob/master/licenses/LICENSE-NETBEANS) |
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
deleted file mode 100755
index 75b52484..00000000
--- a/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 123c4cb1..00000000
--- a/Makefile
+++ /dev/null
@@ -1,48 +0,0 @@
-# text reset
-NO_COLOR=\033[0m
-# green
-OK_COLOR=\033[32;01m
-# red
-ERROR_COLOR=\033[31;01m
-# cyan
-WARN_COLOR=\033[36;01m
-# yellow
-ATTN_COLOR=\033[33;01m
-
-ROOT_DIR := $(shell git rev-parse --show-toplevel)
-
-VERSION := `git describe --tags --dirty 2>/dev/null`
-COMMITHASH := `git rev-parse --short HEAD 2>/dev/null`
-DATE := `date "+%FT%T%z"`
-
-.PHONY: all
-all: init test
-
-init:
- @echo "$(ATTN_COLOR)==> init $(NO_COLOR)"
-
-.PHONY: test
-test:
- @echo "$(ATTN_COLOR)==> test $(NO_COLOR)"
-# @ant test
- @mvn test
-
-.PHONY: test_specific
-test_specific:
- @echo "$(ATTN_COLOR)==> test_specific $(NO_COLOR)"
- @sh ./scripts/test_specific.sh
-
-.PHONY: up
-up:
- @echo "$(ATTN_COLOR)==> up $(NO_COLOR)"
- @docker-compose up -d
-
-.PHONY: wait_up
-wait_up:
- @echo "$(ATTN_COLOR)==> wait_up $(NO_COLOR)"
- @for i in `seq 0 180`; do if docker exec -it splunk /sbin/checkstate.sh &> /dev/null; then break; fi; printf "\rWaiting for Splunk for %s seconds..." $$i; sleep 1; done
-
-.PHONY: down
-down:
- @echo "$(ATTN_COLOR)==> down $(NO_COLOR)"
- @docker-compose stop
diff --git a/README.md b/README.md
deleted file mode 100644
index 8c63c07f..00000000
--- a/README.md
+++ /dev/null
@@ -1,488 +0,0 @@
-[](https://github.com/splunk/splunk-sdk-java/actions/workflows/test.yml)
-# The Splunk Software Development Kit for Java
-
-#### Version 1.9.5
-
-The Splunk Software Development Kit (SDK) for Java contains library code and
-examples designed to enable developers to build applications using Splunk.
-
-Splunk is a search engine and analytic environment that uses a distributed
-map-reduce architecture to efficiently index, search and process large
-time-varying data sets.
-
-The Splunk product is popular with system administrators for aggregation and
-monitoring of IT machine data, security, compliance and a wide variety of
-other scenarios that share a requirement to efficiently index, search, analyze
-and generate real-time notifications from large volumes of time series data.
-
-The Splunk developer platform enables developers to take advantage of the
-same technology used by the Splunk product to build exciting new applications
-that are enabled by Splunk's unique capabilities.
-
-
-## Getting started with the Splunk SDK for Java
-
-The Splunk SDK for Java contains library code and examples that show how to
-programmatically interact with Splunk for a variety of scenarios including
-searching, saved searches, data inputs, and many more, along with building
-complete applications.
-
-The information in this Readme provides steps to get going quickly, but for more
-in-depth information be sure to visit the
-[Splunk Developer Portal](http://dev.splunk.com/view/java-sdk/SP-CAAAECN).
-
-### Requirements
-
-Here's what you need to get going with the Splunk SDK for Java.
-
-#### Splunk
-
-If you haven't already installed Splunk, download it
-[here](http://www.splunk.com/download). For more about installing and running
-Splunk and system requirements, see
-[Installing & Running Splunk](http://dev.splunk.com/view/SP-CAAADRV). The Splunk SDK for Java has been tested with Splunk Enterprise 9.0 and 8.2.
-
-#### Splunk SDK for Java
-
-[Get the Splunk SDK for Java](http://dev.splunk.com/view/SP-CAAAECN)—download the SDK as a ZIP, then extract the files and build the SDK. Or, download the JAR and add it to your project.
-
-If you want to contribute to the SDK, clone the repository from [GitHub](https://github.com/splunk/splunk-sdk-java).
-
-#### Java using Maven
-
-You can use [Apache Maven](http://maven.apache.org/) to build your Splunk SDK for Java projects. With a few updates to your project's `pom.xml` file, it will retrieve all necessary dependencies and seamlessly build your project.
-
-To add the Splunk SDK for Java `.JAR` file as a dependency:
-
-1. Add the repository to your project's `pom.xml` file:
-
-```xml
-
- ...
-
- splunk-artifactory
- Splunk Releases
- http://splunk.jfrog.io/splunk/ext-releases-local
-
-
-```
-
-2. Add the dependency to the `pom.xml` file:
-
-```xml
-
- ...
-
- com.splunk
- splunk
- 1.9.5
-
-
-```
-
-Be sure to update the version number to match the version of the Splunk SDK for Java that you are using.
-
-> Note: You can make similar changes to use [Gradle](http://www.gradle.org/) as well.
-
-### Building the SDK and documentation
-
-To build the SDK, open a command prompt in the **/splunk-sdk-java**
-directory and enter:
-
- mvn
-
-or
-
- mvn package
-
-This command builds all of the .class and .jar files. If you just want to build
-the .class files, enter:
-
- mvn compile
-
-To remove all build artifacts from the repository, enter:
-
- mvn clean
-
-To build the documentation for the SDK, it is being automatically generated with mvn package, otherwise enter:
-
- cd splunk
- mvn javadoc:javadoc
-
-### Usage
-#### Login using username and password
-```java
-import com.splunk.Service;
-import com.splunk.ServiceArgs;
-
-/**
- * Login using username and password
- */
-public class SplunkLogin {
-
- static Service service = null;
- public static void main(String args[]) {
- ServiceArgs loginArgs = new ServiceArgs();
- loginArgs.setPort(8089);
- loginArgs.setHost("localhost");
- loginArgs.setScheme("https");
- loginArgs.setUsername("USERNAME"); // Use your username
- loginArgs.setPassword("PASSWORD"); // Use your password
-
- // Initialize the SDK client
- service = Service.connect(loginArgs);
- }
-}
-```
-
-#### Login using Session Token
-```java
-import com.splunk.Service;
-import com.splunk.ServiceArgs;
-
-/**
- * Login using Session token
- */
-public class SplunkLogin {
-
- static Service service = null;
- /**
- * Session Token.
- * Actual token length would be longer than this token length.
- */
- static String token = "1k_Ostpl6NBe4iVQ5d6I3Ohla_U5";
-
- public static void main(String args[]) {
- ServiceArgs loginArgs = new ServiceArgs();
- loginArgs.setPort(8089);
- loginArgs.setHost("localhost");
- loginArgs.setScheme("https");
- loginArgs.setToken(String.format("Splunk %s", token));
-
- // Initialize the SDK client
- service = Service.connect(loginArgs);
- }
-}
-```
-* Login using username and password will create Session token internally.
-* Login using Credentials (username & password) OR directly using Session token are similar.
-* In above two approaches, there is one limitation that expiration time of Session token cannot be extended. User has to re-login every time when token expires.
-* To overcome this limitation, **Authentication** token is used instead of Session token.
-* In **Authentication** token, user has a provision to set token expiration time. Splunk allows user to set relative/absolute time for token expiration.
-* In other words, **Authentication** token is configurable whereas Session token cannot be configured.
-
-#### Login using Authentication Token (RECOMMENDED)
-```java
-import com.splunk.Service;
-import com.splunk.ServiceArgs;
-
-/**
- * Login using Authentication token
- */
-public class SplunkLogin {
-
- static Service service = null;
- /**
- * Authentication Token.
- * Actual token length would be longer than this token length.
- */
- static String token = "1k_Ostpl6NBe4iVQ5d6I3Ohla_U5";
-
- public static void main(String args[]) {
- ServiceArgs loginArgs = new ServiceArgs();
- loginArgs.setPort(8089);
- loginArgs.setHost("localhost");
- loginArgs.setScheme("https");
- loginArgs.setToken(String.format("Bearer %s", token));
-
- // Initialize the SDK client
- service = Service.connect(loginArgs);
- }
-}
-```
-
-#### Example of running a simple search by first creating the search job
-```java
-import com.splunk.Job;
-import com.splunk.ResultsReader;
-import com.splunk.ResultsReaderXml;
-import com.splunk.Service;
-import com.splunk.ServiceArgs;
-
-/**
- * Logged in using Authentication token.
- * Assuming that authentication token is already created from Splunk web.
- * Create Job using search creation.
- * Read results and print _raw fields
- */
-public class SearchExample {
-
- static Service service = null;
-
- /**
- * Authentication Token.
- * Actual token length would be longer than this token length.
- */
- static String token = "1k_Ostpl6NBe4iVQ5d6I3Ohla_U5";
-
- public static void main(String args[]) {
-
- ServiceArgs loginArgs = new ServiceArgs();
- loginArgs.setPort(8089);
- loginArgs.setHost("localhost");
- loginArgs.setScheme("https");
- loginArgs.setToken(String.format("Bearer %s", token));
-
- // Initialize the SDK client
- service = Service.connect(loginArgs);
-
- // Run a simple search by first creating the search job
- Job job = service.getJobs().create("search index=_internal | head 10");
-
- // Waiting for search results to be ready
- while (!job.isReady()) {
- try {
- Thread.sleep(500); // 500 ms
- } catch (Exception e) {
- // Handle exception here.
- }
- }
-
- // Read results
- try {
- ResultsReader reader = new ResultsReaderXml(job.getEvents());
-
- // Iterate over events and print _raw field
- reader.forEach(event -> System.out.println(event.get("_raw")));
-
- } catch (Exception e) {
- // Handle exception here.
- }
- }
-}
-```
-
-For more information on authentication using tokens, please visit [Splunk Docs](https://docs.splunk.com/Documentation/Splunk/latest/Security/Setupauthenticationwithtokens).
-
-### Unit tests
-
-The Splunk SDK for Java includes several unit tests that are run at
-the command line.
-
-#### Set up the .splunkrc file
-
-To connect to Splunk, many of the SDK examples and unit tests take command-line
-arguments that specify values for the host, port, and login credentials for
-Splunk. For convenience during development, you can store these arguments as
-key-value pairs in a text file named **.splunkrc**. Then, the SDK examples and
-unit tests use the values from the **.splunkrc** file when you don't specify
-them.
-
-To use this convenience file, create a text file with the following format:
-
- # Splunk host (default: localhost)
- host=localhost
- # Splunk admin port (default: 8089)
- port=8089
- # Splunk username
- username=admin
- # Splunk password
- password=changeme
- # Access scheme (default: https)
- scheme=https
- # Your version of Splunk (default: 5.0)
- version=5.0
-
-Save the file as **.splunkrc** in the current user's home directory.
-
-* For example, on Mac OS X, save the file as:
-
- ~/.splunkrc
-
-* On Windows, save the file as:
-
- C:\Users\currentusername\.splunkrc
-
- You might get errors in Windows when you try to name the file because
- ".splunkrc" looks like a nameless file with an extension. You can use
- the command line to create this file—go to the
- **C:\Users\currentusername** directory and enter the following command:
-
- Notepad.exe .splunkrc
-
- Click **Yes**, then continue creating the file.
-
-**Note**: Storing login credentials in the **.splunkrc** file is only for
-convenience during development. This file isn't part of the Splunk platform and
-shouldn't be used for storing user credentials for production. And, if you're
-at all concerned about the security of your credentials, just enter them at
-the command line rather than saving them in this file.
-
-#### Run unit tests
-
-To run the SDK unit tests, open a command prompt in the **/splunk-sdk-java**
-directory and enter:
-
- mvn test
-
-You can also run specific test classes by passing the class to the -Dtest=
-option, e.g.,
-
- mvn test -Dtest=AtomFeedTest
-
-The maven configuration can also produce an HTML report of all the tests automatically when **mvn package / mvn test** are executed.
-Alternate way to generate report is using below command under splunk directory:
-
- mvn jacoco:report
-
-The report will be written in **/splunk-sdk-java/splunk/target/site/surefire-report.html**.
-
-It's also possible to run the units within Java IDEs such as IntelliJ and
-Eclipse. For example, to open the Splunk SDK for Java project in Eclipse:
-
-1. Click **File**, **Import**.
-2. Click **General**, **Existing Projects into Workspace**, then click
- **Next**.
-3. In **Select root directory**, type the path to the Splunk SDK for Java root
- directory (or click **Browse** to locate it), then click **Finish**.
-
-#### Measure code coverage
-
-Measurement of code coverage is generated along with mvn package / mvn test:
-
- mvn jacoco:report
-
-To view the coverage report, open
-**/splunk-sdk-java/splunk/target/test-report/index.html** in your web browser.
-
-## Repository
-
-
-
-
/argsGenerator
-
This directory is created by the build and contains intermediate build
-ouputs
-
-
-
-
/splunk/target
-
This directory is created by the build and contains intermediate build
-ouputs
-
-
-
-
/splunk/src/main
-
Source for com.splunk
-
-
-
-
/splunk/src/test
-
Source for unit tests
-
-
-
-
-### Changelog
-
-The **CHANGELOG.md** file in the root of the repository contains a description
-of changes for each version of the SDK. You can also find it online at
-[https://github.com/splunk/splunk-sdk-java/blob/master/CHANGELOG.md](https://github.com/splunk/splunk-sdk-java/blob/master/CHANGELOG.md).
-
-### Branches
-
-The **master** branch always represents a stable and released version of the SDK.
-You can read more about our branching model on our Wiki at
-[https://github.com/splunk/splunk-sdk-java/wiki/Branching-Model](https://github.com/splunk/splunk-sdk-java/wiki/Branching-Model).
-
-## Documentation and resources
-
-If you need to know more:
-
-* For all things developer with Splunk, your main resource is the [Splunk Developer Portal](http://dev.splunk.com).
-
-* For conceptual and how-to documentation, see the [Overview of the Splunk SDK for Java](http://dev.splunk.com/view/SP-CAAAECN).
-
-* For API reference documentation, see the [Splunk SDK for Java Reference](http://docs.splunk.com/Documentation/JavaSDK).
-
-* For more about the Splunk REST API, see the [REST API Reference](http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI).
-
-* For more about about Splunk in general, see [Splunk>Docs](http://docs.splunk.com/Documentation/Splunk).
-
-* For more about this SDK's repository, see our [GitHub Wiki](https://github.com/splunk/splunk-sdk-java/wiki/).
-
-## Community
-
-Stay connected with other developers building on Splunk.
-
-
-
-
-
Email
-
devinfo@splunk.com
-
-
-
-
Issues
-
https://github.com/splunk/splunk-sdk-java/issues/
-
-
-
-
Answers
-
http://splunk-base.splunk.com/tags/java/
-
-
-
-
Blog
-
http://blogs.splunk.com/dev/
-
-
-
-
Twitter
-
@splunkdev
-
-
-
-
-
-### How to contribute
-
-If you would like to contribute to the SDK, go here for more information:
-
-* [Splunk and open source](http://dev.splunk.com/view/opensource/SP-CAAAEDM)
-
-* [Individual contributions](http://dev.splunk.com/goto/individualcontributions)
-
-* [Company contributions](http://dev.splunk.com/view/companycontributions/SP-CAAAEDR)
-
-### Support
-
-1. You will be granted support if you or your company are already covered
- under an existing maintenance/support agreement. Send an email to
- _support@splunk.com_ and include "Splunk SDK for Java" in the subject line.
-
-2. If you are not covered under an existing maintenance/support agreement, you
- can find help through the broader community at:
-
-
-
Splunk Answers (use
- the sdk, java, python, and javascript tags to
- identify your questions)
-3. Splunk will NOT provide support for SDKs if the core library (the
- code in the splunk directory) has been modified. If you modify an SDK
- and want support, you can find help through the broader community and Splunk
- answers (see above). We would also like to know why you modified the core
- library—please send feedback to _devinfo@splunk.com_.
-4. File any issues on [GitHub](https://github.com/splunk/splunk-sdk-java/issues).
-
-
-### Contact Us
-
-You can reach the Developer Platform team at _devinfo@splunk.com_.
-
-## License
-
-The Splunk Java Software Development Kit is licensed under the Apache
-License 2.0. Details can be found in the LICENSE file.
diff --git a/argsGenerator/README.md b/argsGenerator/README.md
deleted file mode 100644
index a0294583..00000000
--- a/argsGenerator/README.md
+++ /dev/null
@@ -1,128 +0,0 @@
-# Args Class Generator
-
-This tool generates custom `Args` subclasses based on the REST API documentation for the associated endpoint.
-
-
-## Example Usage
-
-```
-./gen_args_class.py < specs/JobArgs_POST__search_jobs.argspec > Output.java
-```
-
-
-## Quickstart
-
-For each class that you want to generate, an `.argspec` file must be created that defines the specific parameters supported by the Args class, along with its Java datatype and documentation.
-
-For example, the specification:
-
-```
-auto_cancel
-AutoCancel
-int
-Sets the number of seconds of inactivity after which to automatically cancel a job. A value of 0 means never auto-cancel.
--
-The number of seconds after which to cancel a job.
-===
-```
-
-...generates the following code:
-
-```
- /* BEGIN AUTOGENERATED CODE */
-
- /**
- * Sets the number of seconds of inactivity after which to automatically cancel a job. A value of 0 means never auto-cancel.
- *
- * @param autoCancel
- * The number of seconds after which to cancel a job.
- */
- public void setAutoCancel(int autoCancel) {
- this.put("auto_cancel", autoCancel);
- }
-
- /* END AUTOGENERATED CODE */
-```
-
-Notice that the generator does not generate an entire class, but rather only its methods.
-The user must manually:
-
-* Create the class definition and documentation.
-* Add the constructor.
-* Add any nested `enum` types that the generated setters require.
-
-
-## Argument Specification Format
-
-Any line that begins with `#` is a comment and will be ignored. Blank lines are significant (and are not ignored).
-
-Any line at the beginning of the file that begins with `!` is a directive and will change the behavior of the generator. For example:
-
-```
-# Some arguments are defined multiple times by different copied sections.
-# Ignore errors related to this. The first version wins.
-!SET ignore_duplicates 1
-```
-
-The rest of the file is a series of argument definitions:
-
-```
-<< machine name >>
-<< Java name (upper camelcase) >>
-<< Java type >>
-<< method description line #1 >>
-<< method description line .. >>
-<< method description line #n >>
--
-<< parameter description line #1 >>
-<< parameter description line .. >>
-<< parameter description line #n >>
-===
-```
-
-Note that the last specification must still end with a `===` line.
-
-### Special Java Types
-
-A few values for `<< Java type >>` are handled specially:
-
-* `String[]-MULTIPLE` - Each value will be a separate parameter.
- * For example "f = {1,2,3}" would appear as `f=1&f=2&f=3` in the final URL.
-* `String[]-CSV` - Values will be submitted as a single comma-separated parameter.
- * For example "f = {1,2,3}" would appear as `f=1,2,3` in the final URL.
-
-### Custom Setter Code
-
-For more complex cases where the generated accessor is not appropriate (like the Java type `Date`), you can also specify custom code for an argument by adding a `!CODE` line after the argument description and follow that line with custom Java code.
-
-For example:
-
-```
-dispatch.earliest_time
-DispatchEarliestTime
-Date
-Sets the earliest time for this search.
--
-A date that specifies the earliest time for this search.
-!CODE
- String javaFormatString = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
- String timeString = new SimpleDateFormat(javaFormatString).format(dispatchEarliestTime);
- this.put("dispatch.earliest_time", timeString);
-===
-```
-
-...generates this code:
-
-```
- /**
- * Sets the earliest time for this search.
- *
- * @param dispatchEarliestTime
- * A date that specifies the earliest time for this search.
- */
- public void setDispatchEarliestTime(Date dispatchEarliestTime) {
- String javaFormatString = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
- String timeString = new SimpleDateFormat(javaFormatString).format(dispatchEarliestTime);
- this.put("dispatch.earliest_time", timeString);
- }
-```
\ No newline at end of file
diff --git a/argsGenerator/gen_args_class.py b/argsGenerator/gen_args_class.py
deleted file mode 100755
index a5c3d720..00000000
--- a/argsGenerator/gen_args_class.py
+++ /dev/null
@@ -1,159 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-
-input = sys.stdin
-output = sys.stdout
-
-
-def read_line():
- """
- Returns the next line from the input, including the EOL sequence.
- Throws StopIteration on EOF.
-
- Skips comment lines automatically.
- """
- while True:
- line = next(input)
- if line.startswith('#'):
- continue
- return line
-
-
-def lowercase_first_letter(string):
- return string[0].lower() + string[1:]
-
-
-output.write(""" /* BEGIN AUTOGENERATED CODE */
-
-""")
-
-ignore_duplicates = False
-args_already_seen = set()
-ignored_machine_names = set()
-
-try:
- while True:
- machine_name = read_line()[:-1]
- if machine_name.startswith('!'):
- # Actually this is a directive. Process it.
- directive = machine_name
- if directive == '!SET ignore_duplicates 1':
- ignore_duplicates = True
- elif directive.startswith('!SUPPRESS '):
- machine_name = directive[len('!SUPPRESS '):]
- ignored_machine_names.add(machine_name)
- else:
- sys.exit("Unknown directive: %s" % directive)
- continue
- java_name = read_line()[:-1]
- type = read_line()[:-1]
-
- description_lines = []
- reading_description = True
- code_lines = None
- while True:
- line = read_line()
- if line.startswith('!CODE'):
- code_lines = []
- reading_description = False
- continue
- if line.startswith('='):
- break
-
- if reading_description:
- description_lines.append(line)
- else:
- code_lines.append(line)
-
- if not java_name[0].isupper():
- sys.exit("Expected first letter to be uppercase: %s" % java_name)
- java_name_lower = lowercase_first_letter(java_name)
-
- # Generate the setter code
- if code_lines is not None:
- # Custom code for this setter
- code = ''.join(code_lines)[:-1];
- else:
- # Standard code for this setter, depending on its parameter type
- code = """ this.put("%s", %s);""" % (machine_name, java_name_lower)
- if '[]' in type or type == 'Date':
- if type == 'String[]-MULTIPLE':
- type = 'String[]'
- code = """ this.put("%s", %s);""" % (machine_name, java_name_lower)
- elif type == 'String[]-CSV':
- type = 'String[]'
- code = """ StringBuilder csv = new StringBuilder();
- for (int i = 0, n = %s.length; i < n; i++) {
- if (i != 0) {
- csv.append(",");
- }
- csv.append(%s[i]);
- }
-
- this.put("%s", String.valueOf(csv));""" % (java_name_lower, java_name_lower, machine_name)
- else:
- sys.exit("Don't know how to encode an array of type: %s" % type);
-
- # Split description_lines -> {method_description_lines, param_description_lines}
- method_description_lines = []
- param_description_lines = []
- saw_description_separator = False
- for line in description_lines:
- if line.startswith('-'):
- saw_description_separator = True
- continue
-
- if not saw_description_separator:
- method_description_lines.append(line)
- else:
- param_description_lines.append(line)
-
- if not saw_description_separator:
- print ('WARNING: No separate method description found for ' +
- 'argument %s. This is against convention.') % machine_name
- param_description_lines = method_description_lines
- method_description_lines = []
-
- # Format method_description_lines
- method_description_formatted = ''
- if method_description_lines != []:
- for line in method_description_lines:
- method_description_formatted += ' * %s' % line
- method_description_formatted += ' * \n'
-
- # Format param_description_lines
- param_description_formatted = ''
- for line in param_description_lines:
- param_description_formatted += ' * %s' % line
-
- cur_arg = (machine_name, type)
- if cur_arg in args_already_seen:
- if ignore_duplicates:
- continue
- else:
- sys.exit("Multiple definitions for argument: %s %s" % (
- type, machine_name));
- else:
- args_already_seen.add(cur_arg)
-
- # Output the current argument
- if machine_name not in ignored_machine_names:
- output.write(""" /**
-%s * @param %s
-%s */
- public void set%s(%s %s) {
-%s
- }
-
-""" % (method_description_formatted,
- java_name_lower, param_description_formatted,
- java_name, type, java_name_lower,
- code))
-
-except StopIteration:
- # Done!
- pass
-
-output.write(""" /* END AUTOGENERATED CODE */
-""")
\ No newline at end of file
diff --git a/argsGenerator/specs/CollectionArgs__GET_collection.argspec b/argsGenerator/specs/CollectionArgs__GET_collection.argspec
deleted file mode 100644
index 01d52797..00000000
--- a/argsGenerator/specs/CollectionArgs__GET_collection.argspec
+++ /dev/null
@@ -1,63 +0,0 @@
-app
-App
-String
-Sets the app context in which to list the collection.
--
-The app context in which to list the collection. A {@code null} value indicates no app context, and a value of {@code "-"} indicates an app wildcard.
-===
-owner
-Owner
-String
-Sets the owner context in which to list the collection.
--
-The owner context in which to list the collection. A value of {@code "-"} indicates a wildcard, and a {@code null} value indicates no owner context.
-===
-sharing
-Sharing
-String
-Sets the sharing context in which to list the collection.
--
-The sharing context in which to list the collection. Valid values are "user", "app", "global", and "system".
-===
-count
-Count
-int
-Sets the maximum number of entries to return.
--
-The maximum number of entries to return. To return all entries, specify 0.
-===
-offset
-Offset
-int
-Sets the index of the first entry to return.
--
-The index of the first entry to return.
-===
-search
-Search
-String
-Sets a search query to filter the response. The response matches field values against the search query. For example, "foo" matches any object that has "foo" as a substring in a field, and "field_name=field_value" restricts the match to a single field.
--
-A search query to filter the response.
-===
-sort_dir
-SortDirection
-SortDirection
-Sets the direction to sort entries.
--
-The sorting order--ascending or descending.
-===
-sort_key
-SortKey
-String
-Sets the field to use for sorting.
--
-The field to sort by.
-===
-sort_mode
-SortMode
-SortMode
-Sets the mode to use for sorting.
--
-The collating sequence for sorting entries.
-===
diff --git a/argsGenerator/specs/IndexCollectionArgs__GET_data_indexes.argspec b/argsGenerator/specs/IndexCollectionArgs__GET_data_indexes.argspec
deleted file mode 100644
index 4b073d67..00000000
--- a/argsGenerator/specs/IndexCollectionArgs__GET_data_indexes.argspec
+++ /dev/null
@@ -1,17 +0,0 @@
-count
-Count
-int
-Sets the maximum number of entries to return.
--
-The maximum number of entries to return. To return all entries, specify -1.
-!CODE
- super.setCount(count);
-===
-summarize
-Summarize
-boolean
-Sets whether to omits certain index details to provide a faster response.
--
-{@code true} to omit index details for a faster response,
-{@code false} if not.
-===
diff --git a/argsGenerator/specs/JobArgs__POST_search_jobs.argspec b/argsGenerator/specs/JobArgs__POST_search_jobs.argspec
deleted file mode 100644
index 3b00c1af..00000000
--- a/argsGenerator/specs/JobArgs__POST_search_jobs.argspec
+++ /dev/null
@@ -1,206 +0,0 @@
-# NOTE: Large sections of this specification have been copied to
-# JobExportArgs__GET_search_jobs_export.argspec, which should be
-# updated (and regenerated) to reflect changes made to this file.
-#
-auto_cancel
-AutoCancel
-int
-Sets the number of seconds of inactivity after which to automatically cancel a job. A value of 0 means never auto-cancel.
--
-The number of seconds after which to cancel a job.
-===
-auto_finalize_ec
-AutoFinalizeEventCount
-int
-Sets the number of events to process after which to auto-finalize the search. A value of 0 means no limit.
--
-The number of events.
-===
-auto_pause
-AutoPause
-int
-Sets the number of seconds of inactivity after which to automatically pause a job. A value of 0 means never auto-pause.
--
-The number of seconds after which to pause.
-===
-# TODO: Make Date version.
-earliest_time
-EarliestTime
-String
-Specifies the earliest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
--
-The earliest time.
-===
-enable_lookups
-EnableLookups
-boolean
-Indicates whether to enable lookups for this search. Enabling lookups might slow searches significantly depending on the nature of the lookups.
--
-{@code true} to enable lookups, {@code false} if not.
-===
-exec_mode
-ExecutionMode
-ExecutionMode
-Sets the type of search to run ("blocking", "oneshot", or "normal").
--
-The search type.
-===
-force_bundle_replication
-ForceBundleReplication
-boolean
-Specifies whether this search should cause (and wait depending on the value of {@code setSynchronizeBundleReplication}) bundle synchronization with all search peers.
--
-{@code true} if this search should cause bundle synchronization,
-{@code false} if not.
-===
-id
-Id
-String
-Sets a search ID (SID). If unspecified, a random ID is generated.
--
-The search ID.
-===
-# TODO: Make Date version.
-latest_time
-LatestTime
-String
-Specifies the latest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
--
-The latest time.
-===
-max_count
-MaximumCount
-int
-Sets the number of events that can be accessible in any given status bucket. Also, in transforming mode, this sets the maximum number of results to store. Specifically, in all calls, {@code codeoffset + count <= max_count}.
--
-The maximum count of events.
-===
-max_time
-MaximumTime
-int
-Sets the maximum number of seconds to run this search before finalizing. Specify 0 to never finalize.
--
-The maximum time, in seconds.
-===
-namespace
-Namespace
-String
-Specifies the application namespace to which to restrict searches.
--
-The namespace.
-===
-# TODO: Improve docs: What is the accepted time format?
-# TODO: Make Date version.
-now
-Now
-String
-Specifies a time string that sets the absolute time used for any relative time specifier in the search. This value defaults to the current system time.
You can specify a relative time modifier for this parameter. For example, specify +2d to specify the current time plus two days. If you specify a relative time modifier both in this parameter and in the search string, the search string modifier takes precedence.
For information about relative time modifiers, see Time modifiers for search in the Search Reference.
--
-The time string.
-===
-reduce_freq
-ReduceFrequency
-int
-Sets the time to wait between running the MapReduce phase on accumulated map values.
--
-The time to wait, in seconds.
-===
-reload_macros
-ReloadMacros
-boolean
-Indicates whether to reload macro definitions from the macros.conf configuration file.
--
-{@code true} to reload macro definitions, {@code false} if not.
-===
-remote_server_list
-RemoteServerList
-String[]-CSV
-Sets a list of (possibly wildcarded) servers from which to pull raw events. This same server list is used in subsearches.
--
-The list of servers.
-===
-rf
-RequiredFieldList
-String[]-MULTIPLE
-Sets one or more required fields to the search. These fields, even if not referenced or used directly by the search, are still included by the events and summary endpoints. Splunk Web uses these fields to prepopulate panels in the Search view.
--
-The list of fields.
-===
-rt_blocking
-RealtimeBlocking
-boolean
-Indicates whether the indexer blocks if the queue for this search is full. Only applies to real-time searches.
--
-{@code true} to block the indexer for a full queue, {@code false} if not.
-===
-rt_indexfilter
-RealtimeIndexFilter
-boolean
-Indicates whether the indexer pre-filters events. Only applies to real-time searches.
--
-{@code true} to pre-filter events, {@code false} if not.
-===
-rt_maxblocksecs
-RealtimeMaximumBlockSeconds
-int
-Sets the number of seconds indicating the maximum time to block. A value of 0 means no limit. For real-time searches with "rt_blocking" set to {@code true}.
--
-The maximum time to block, in seconds.
-===
-rt_queue_size
-RealtimeQueueSize
-int
-Sets the number indicating the queue size (in events) that the indexer should use for this search. Only applies to real-time searches.
--
-The queue size, in events.
-===
-search_listener
-SearchListener
-String
-Sets a string that registers a search state listener with the search. Use the format: {@code search_state;results_condition;http_method;uri;}
For example:
{@code search_listener=onResults;true;POST;/servicesNS/admin/search/saved/search/foobar/notify;}
--
-The search listener string.
-===
-search_mode
-SearchMode
-SearchMode
-Sets the search mode ("normal" or "realtime").
--
-The search mode.
-===
-spawn_process
-SpawnProcess
-boolean
-Indicates whether the search should run in a separate spawned process. Searches against indexes must run in a separate process.
--
-{@code true} to run the search in a separate process, {@code false} if not.
-===
-status_buckets
-StatusBuckets
-int
-Sets the maximum number of status buckets to generate. A value of 0 means to not generate timeline information.
--
-The maximum number of buckets.
-===
-sync_bundle_replication
-SynchronizeBundleReplication
-boolean
-Indicates whether this search should wait for bundle replication to complete.
--
-{@code true} to wait for bundle replication, {@code false} if not.
-===
-# TODO: Improve docs: There is no {start,end}_time. Perhaps {earliest,latest}_time was intended?
-time_format
-TimeFormat
-String
-Sets the format for converting a formatted time string from {start,end}_time into UTC seconds. The default value is ISO-8601.
--
-The time format string.
-===
-timeout
-Timeout
-int
-Sets the number of seconds to keep this search after processing has stopped.
--
-The timeout, in seconds.
-===
\ No newline at end of file
diff --git a/argsGenerator/specs/JobEventsArgs__GET_search_jobs_NAME_events.argspec b/argsGenerator/specs/JobEventsArgs__GET_search_jobs_NAME_events.argspec
deleted file mode 100644
index 8f27af38..00000000
--- a/argsGenerator/specs/JobEventsArgs__GET_search_jobs_NAME_events.argspec
+++ /dev/null
@@ -1,95 +0,0 @@
-# NOTE: The entire contents of this specification have been copied to
-# JobExportArgs__GET_search_jobs_export.argspec, which should be
-# updated (and regenerated) to reflect changes made to this file.
-#
-count
-Count
-int
-Sets the maximum number of results to return. To return all available results, specify 0. The default value is 100.
--
-The maximum number of results.
-===
-# TODO: Make Date version.
-earliest_time
-EarliestTime
-String
-Specifies the earliest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
--
-The earliest time.
-===
-f
-FieldList
-String[]-MULTIPLE
-Sets a list of fields to return for the event set.
--
-A list of fields.
-===
-# TODO: Make Date version.
-latest_time
-LatestTime
-String
-Specifies the latest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
--
-The latest time.
-===
-max_lines
-MaximumLines
-int
-Sets the maximum number of lines that any single event's _raw field should contain.
--
-The maximum number of lines. For no limit, specify 0.
-===
-offset
-Offset
-int
-Specifies the index of the first result (inclusive) from which to begin returning data. This value is 0-indexed.
In Splunk 4.1+, negative offsets are allowed and are added to the count to compute the absolute offset (for example, offset=-1 is the last available offset). Offsets in the results are always absolute and never negative. The default value is 0.
--
-The index of the first result to return.
-===
-# TODO: Improve docs: The referenced document does not actually document the enum constants.
-output_mode
-OutputMode
-OutputMode
-Sets the format of the output.
--
-The output format.
-===
-output_time_format
-OutputTimeFormat
-String
-Sets a UTC time format.
--
-A UTC time format.
-===
-search
-Search
-String
-Sets the post-processing search to apply to results.
--
-The post-processing search query.
-===
-# TODO: Improve docs: What are the valid values for this parameter?
-segmentation
-Segmentation
-String
-Sets the type of segmentation to perform on the data, including an option to perform k/v segmentation.
--
-The segmentation type.
-===
-# TODO: Are you sure this is the default? This time format lacks time zone and millisecond resolution.
-# TODO: Improve docs: There is no {start,end}_time. Perhaps {earliest,latest}_time was intended?
-time_format
-TimeFormat
-String
-Specifies an expression to convert a formatted time string from {start,end}_time into UTC seconds. The default format is "%m/%d/%Y:%H:%M:%S".
--
-The time format.
-===
-# TODO: Improve docs: What effect does each value have?
-truncation_mode
-TruncationMode
-TruncationMode
-Specifies how to truncate lines to achieve the value in {@link #setMaximumLines}.
--
-The truncation mode.
-===
diff --git a/argsGenerator/specs/JobExportArgs__GET_search_jobs_export.argspec b/argsGenerator/specs/JobExportArgs__GET_search_jobs_export.argspec
deleted file mode 100644
index 02fe3438..00000000
--- a/argsGenerator/specs/JobExportArgs__GET_search_jobs_export.argspec
+++ /dev/null
@@ -1,372 +0,0 @@
-# This endpoint is unusual in that most of its arguments are copied straight
-# from other endpoints. In particular:
-# * POST search/jobs
-# * GET search/jobs/{search_id}/events
-# * GET search/jobs/{search_id}/results
-#
-# Sections of arguments that have been copied from other files are clearly
-# marked by comments.
-#
-# %%%%%%%%%%%%%%%%%%
-# %%% DIRECTIVES %%%
-# %%%%%%%%%%%%%%%%%%
-#
-# Some arguments are defined multiple times by different copied sections.
-# Ignore errors related to this. The first version wins.
-!SET ignore_duplicates 1
-#
-# Some arguments from included endpoints do not apply. Ignore them.
-!SUPPRESS id
-!SUPPRESS count
-!SUPPRESS f
-!SUPPRESS offset
-!SUPPRESS search
-#
-# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-# %%% Unique to this endpoint %%%
-# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-# TODO: Improve docs: What is the accepted time format?
-# TODO: Make Date version.
-index_earliest
-IndexEarliest
-String
-Specifies the earliest time in the time range to search, based on the index time. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
--
-The earliest time.
-===
-# TODO: Improve docs: What is the accepted time format?
-# TODO: Make Date version.
-index_latest
-IndexLatest
-String
-Specifies the latest time in the time range to search, based on the index time. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
--
-The latest time.
-===
-output_mode
-OutputMode
-OutputMode
-Sets the format of the output.
--
-The output format.
-===
-# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-# %%% Subset of arguments from POST search/jobs %%%
-# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-auto_cancel
-AutoCancel
-int
-Sets the number of seconds of inactivity after which to automatically cancel a job. A value of 0 means never auto-cancel.
--
-The number of seconds after which to cancel a job.
-===
-auto_finalize_ec
-AutoFinalizeEventCount
-int
-Sets the number of events to process after which to auto-finalize the search. A value of 0 means no limit.
--
-The number of events.
-===
-auto_pause
-AutoPause
-int
-Sets the number of seconds of inactivity after which to automatically pause a job. A value of 0 means never auto-pause.
--
-The number of seconds after which to pause.
-===
-# TODO: Make Date version.
-earliest_time
-EarliestTime
-String
-Specifies the earliest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
--
-The earliest time.
-===
-enable_lookups
-EnableLookups
-boolean
-Indicates whether to enable lookups for this search. Enabling lookups might slow searches significantly depending on the nature of the lookups.
--
-{@code true} to enable lookups, {@code false} if not.
-===
-force_bundle_replication
-ForceBundleReplication
-boolean
-Specifies whether this search should cause (and wait depending on the value of {@code setSynchronizeBundleReplication}) bundle synchronization with all search peers.
--
-{@code true} if this search should cause bundle synchronization, {@code false} if not.
-===
-id
-Id
-String
-Sets a search ID (SID). If unspecified, a random ID is generated.
--
-The search ID.
-===
-# TODO: Make Date version.
-latest_time
-LatestTime
-String
-Specifies the latest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
--
-The latest time.
-===
-max_time
-MaximumTime
-int
-Sets the number of seconds to run this search before finalizing. Specify 0 to never finalize.
--
-The maximum time, in seconds.
-===
-namespace
-Namespace
-String
-Specifies the application namespace in which to restrict searches.
--
-The namespace.
-===
-# TODO: Improve docs: What is the accepted time format?
-# TODO: Make Date version.
-now
-Now
-String
-Specifies a time string that sets the absolute time used for any relative time specifier in the search. This value defaults to the current system time.
You can specify a relative time modifier for this parameter. For example, specify +2d to specify the current time plus two days. If you specify a relative time modifier both in this parameter and in the search string, the search string modifier takes precedence.
For information about relative time modifiers, see Time modifiers for search in the Search Reference.
--
-A time string.
-===
-reduce_freq
-ReduceFrequency
-int
-Sets the time to wait between running the MapReduce phase on accumulated map values.
--
-The time to wait, in seconds.
-===
-reload_macros
-ReloadMacros
-boolean
-Indicates whether to reload macro definitions from the macros.conf configuration file.
--
-{@code true} to reload macro definitions, {@code false} if not.
-===
-remote_server_list
-RemoteServerList
-String[]-CSV
-Sets a list of (possibly wildcarded) servers from which to pull raw events. This same server list is used in subsearches.
--
-A list of servers.
-===
-rf
-RequiredFieldList
-String[]-MULTIPLE
-Sets one or more required fields to the search. These fields, even if not referenced or used directly by the search, are still included by the events and summary endpoints. Splunk Web uses these fields to prepopulate panels in the Search view.
--
-The list of fields.
-===
-rt_blocking
-RealtimeBlocking
-boolean
-Indicates whether the indexer blocks if the queue for this search is full. Only applies to real-time searches.
--
-{@code true} to block the indexer for a full queue, {@code false} if not.
-===
-rt_indexfilter
-RealtimeIndexFilter
-boolean
-Indicates whether the indexer pre-filters events. Only applies to real-time searches.
--
-{@code true} to pre-filter events, {@code false} if not.
-===
-rt_maxblocksecs
-RealtimeMaximumBlockSeconds
-int
-Sets the number of seconds indicating the maximum time to block. A value of 0 means no limit. For real-time searches with "rt_blocking" set to {@code true}.
--
-The maximum time to block, in seconds.
-===
-rt_queue_size
-RealtimeQueueSize
-int
-Sets the number indicating the queue size (in events) that the indexer should use for this search. Only applies to real-time searches.
--
-The queue size, in events.
-===
-search_listener
-SearchListener
-String
-Sets a string that registers a search state listener with the search. Use the format: {@code search_state;results_condition;http_method;uri;}
For example:
{@code search_listener=onResults;true;POST;/servicesNS/admin/search/saved/search/foobar/notify;}
--
-The search listener string.
-===
-search_mode
-SearchMode
-SearchMode
-Sets the search mode ("normal" or "realtime").
--
-The search mode.
-===
-sync_bundle_replication
-SynchronizeBundleReplication
-boolean
-Indicates whether this search should wait for bundle replication to complete.
--
-{@code true} to wait for bundle replication, {@code false} if not.
-===
-# TODO: Improve docs: There is no {start,end}_time. Perhaps {earliest,latest}_time was intended?
-time_format
-TimeFormat
-String
-Sets the format for converting a formatted time string from {start,end}_time into UTC seconds. The default value is ISO-8601.
--
-The time format string.
-===
-timeout
-Timeout
-int
-Sets the number of seconds to keep this search after processing has stopped.
--
-The timeout, in seconds.
-===
-# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-# %%% GET search/jobs/{search_id}/events %%%
-# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-# NOTE: The entire contents of this specification have been copied to
-# JobExportArgs__GET_search_jobs_export.argspec, which should be
-# updated (and regenerated) to reflect changes made to this file.
-#
-count
-Count
-int
-Sets the maximum number of results to return. To return all available results, specify 0. The default value is 100.
--
-The maximum number of results.
-===
-# TODO: Make Date version.
-earliest_time
-EarliestTime
-String
-Specifies the earliest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
--
-The earliest time.
-===
-f
-FieldList
-String[]-MULTIPLE
-Sets a list of fields to return for the event set.
--
-A list of fields.
-===
-# TODO: Make Date version.
-latest_time
-LatestTime
-String
-Specifies the latest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
--
-The latest time.
-===
-max_lines
-MaximumLines
-int
-Sets the maximum number of lines that any single event's _raw field should contain.
--
-The maximum number of lines. For no limit, specify 0.
-===
-offset
-Offset
-int
-Specifies the index of the first result (inclusive) from which to begin returning data. This value is 0-indexed.
In Splunk 4.1+, negative offsets are allowed and are added to the count to compute the absolute offset (for example, offset=-1 is the last available offset). Offsets in the results are always absolute and never negative. The default value is 0.
--
-The index of the first result to return.
-===
-# TODO: Improve docs: The referenced document does not actually document the enum constants.
-output_mode
-OutputMode
-OutputMode
-Sets the format of the output.
--
-The output format.
-===
-output_time_format
-OutputTimeFormat
-String
-Sets a UTC time format.
--
-A UTC time format.
-===
-search
-Search
-String
-Sets the post-processing search to apply to results.
--
-The post-processing search query.
-===
-# TODO: Improve docs: What are the valid values for this parameter?
-segmentation
-Segmentation
-String
-Sets the type of segmentation to perform on the data, including an option to perform k/v segmentation.
--
-The segmentation type.
-===
-# TODO: Are you sure this is the default? This time format lacks time zone and millisecond resolution.
-# TODO: Improve docs: There is no {start,end}_time. Perhaps {earliest,latest}_time was intended?
-time_format
-TimeFormat
-String
-Specifies an expression to convert a formatted time string from {start,end}_time into UTC seconds. The default format is "%m/%d/%Y:%H:%M:%S".
--
-The time format.
-===
-# TODO: Improve docs: What effect does each value have?
-truncation_mode
-TruncationMode
-TruncationMode
-Specifies how to truncate lines to achieve the value in {@link #setMaximumLines}.
--
-The truncation mode.
-===
-# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-# %%% GET search/jobs/{search_id}/results %%%
-# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-# NOTE: The entire contents of this specification have been copied to
-# JobExportArgs__GET_search_jobs_export.argspec, which should be
-# updated (and regenerated) to reflect changes made to this file.
-#
-# TODO: Improve docs: Formatting of the description differs from that of
-# GET search/jobs/{search_id}/results. Otherwise all other parameters are identical.
-count
-Count
-int
-Sets the maximum number of results to return.
--
-The maximum number of results. To return all available results, specify 0.
-===
-# TODO: Improve docs: Why isn't "field_list" deprecated when there is "f" present?
-f
-FieldList
-String[]-MULTIPLE
-Sets a list of fields to return for the event set.
--
-A list of fields.
-===
-offset
-Offset
-int
-Specifies the index of the first result (inclusive) from which to begin returning data. This value is 0-indexed.
In Splunk 4.1+, negative offsets are allowed and are added to the count to compute the absolute offset (for example, offset=-1 is the last available offset). Offsets in the results are always absolute and never negative. The default value is 0.
--
-The index of the first result to return.
-===
-# TODO: Improve docs: The referenced document does not actually document the enum constants.
-output_mode
-OutputMode
-OutputMode
-Sets the format of the output.
--
-The output format.
-===
-search
-Search
-String
-Sets the post-processing search to apply to results.
--
-The post-processing search query.
-===
diff --git a/argsGenerator/specs/JobResultsArgs__GET_search_jobs_NAME_results.argspec b/argsGenerator/specs/JobResultsArgs__GET_search_jobs_NAME_results.argspec
deleted file mode 100644
index 5a13dfd5..00000000
--- a/argsGenerator/specs/JobResultsArgs__GET_search_jobs_NAME_results.argspec
+++ /dev/null
@@ -1,43 +0,0 @@
-# NOTE: The entire contents of this specification have been copied to
-# JobExportArgs__GET_search_jobs_export.argspec, which should be
-# updated (and regenerated) to reflect changes made to this file.
-#
-# TODO: Improve docs: Formatting of the description differs from that of
-# GET search/jobs/{search_id}/results. Otherwise all other parameters are identical.
-count
-Count
-int
-Sets the maximum number of results to return.
--
-The maximum number of results. To return all available results, specify 0.
-===
-# TODO: Improve docs: Why isn't "field_list" deprecated when there is "f" present?
-f
-FieldList
-String[]-MULTIPLE
-Sets a list of fields to return for the event set.
--
-A list of fields.
-===
-offset
-Offset
-int
-Specifies the index of the first result (inclusive) from which to begin returning data. This value is 0-indexed.
In Splunk 4.1+, negative offsets are allowed and are added to the count to compute the absolute offset (for example, offset=-1 is the last available offset). Offsets in the results are always absolute and never negative. The default value is 0.
--
-The index of the first result to return.
-===
-# TODO: Improve docs: The referenced document does not actually document the enum constants.
-output_mode
-OutputMode
-OutputMode
-Sets the format of the output.
--
-The output format.
-===
-search
-Search
-String
-Sets the post-processing search to apply to results.
--
-The post-processing search query.
-===
diff --git a/argsGenerator/specs/JobResultsPreviewArgs__GET_search_jobs_NAME_results_preview.argspec b/argsGenerator/specs/JobResultsPreviewArgs__GET_search_jobs_NAME_results_preview.argspec
deleted file mode 100644
index a37eb28a..00000000
--- a/argsGenerator/specs/JobResultsPreviewArgs__GET_search_jobs_NAME_results_preview.argspec
+++ /dev/null
@@ -1,39 +0,0 @@
-# TODO: Improve docs: Formatting of the description differs from that of
-# GET search/jobs/{search_id}/results_preview. Otherwise all other parameters are identical.
-count
-Count
-int
-Sets the maximum number of results to return.
--
-The maximum number of results. To return all available results, specify 0.
-===
-# TODO: Improve docs: Why isn't "field_list" deprecated when there is "f" present?
-f
-FieldList
-String[]-MULTIPLE
-Sets a list of fields to return for the event set.
--
-A list of fields.
-===
-offset
-Offset
-int
-Specifies the index of the first result (inclusive) from which to begin returning data. This value is 0-indexed.
In Splunk 4.1+, negative offsets are allowed and are added to the count to compute the absolute offset (for example, offset=-1 is the last available offset). Offsets in the results are always absolute and never negative. The default value is 0.
--
-The index of the first result to return.
-===
-# TODO: Improve docs: The referenced document does not actually document the enum constants.
-output_mode
-OutputMode
-OutputMode
-Sets the format of the output.
--
-The output format.
-===
-search
-Search
-String
-Sets the post-processing search to apply to results.
--
-The post-processing search query.
-===
diff --git a/argsGenerator/specs/JobSummaryArgs__GET_search_jobs_NAME_summary.argspec b/argsGenerator/specs/JobSummaryArgs__GET_search_jobs_NAME_summary.argspec
deleted file mode 100644
index ee99882a..00000000
--- a/argsGenerator/specs/JobSummaryArgs__GET_search_jobs_NAME_summary.argspec
+++ /dev/null
@@ -1,72 +0,0 @@
-# TODO: Make Date version.
-# TODO: Improve docs: "respectively"?
-earliest_time
-EarliestTime
-String
-Specifies the earliest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
--
-The earliest time.
-===
-f
-FieldList
-String[]-MULTIPLE
-Sets a list of fields to return for the event set.
--
-A list of fields.
-===
-histogram
-Histogram
-boolean
-Indicates whether to add histogram data to the summary output.
--
-{@code true} to add histogram data, {@code false} if not.
-===
-# TODO: Make Date version.
-# TODO: Improve docs: "respectively"?
-latest_time
-LatestTime
-String
-Specifies the latest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string.
--
-The latest time.
-===
-min_freq
-MinimumFrequency
-double
-Sets the fraction of results for each key that this key must occur in to be displayed.
--
-The frequency, as a fraction (a value between 0 and 1).
-===
-# TODO: Improve docs: The description and default value contradict each other.
-output_time_format
-OutputTimeFormat
-String
-Sets a UTC time format.
--
-A UTC time format.
-===
-search
-Search
-String
-Sets a search query to filter the response. The response matches field values against the search query. For example, "foo" matches any object that has "foo" as a substring in a field, and "field_name=field_value" restricts the match to a single field.
--
-A search substring.
-===
-# TODO: Improve docs: The default value specified does not match that of the description.
-# (It is missing a trailing S). The description version is probably right.
-# TODO: Improve docs: Are you sure this is the default? This time format lacks time zone and millisecond resolution.
-# TODO: Improve docs: There is no {start,end}_time. Perhaps {earliest,latest}_time was intended?
-time_format
-TimeFormat
-String
-Specifies an expression to convert a formatted time string from {start,end}_time into UTC seconds. The default format is "%m/%d/%Y:%H:%M:%S".
--
-The time format.
-===
-top_count
-TopCount
-int
-Sets for each key how many of the most frequent items to return.
--
-The number of items to return.
-===
diff --git a/argsGenerator/specs/SavedSearchCollectionArgs__GET_saved_searches.argspec b/argsGenerator/specs/SavedSearchCollectionArgs__GET_saved_searches.argspec
deleted file mode 100644
index 489f6485..00000000
--- a/argsGenerator/specs/SavedSearchCollectionArgs__GET_saved_searches.argspec
+++ /dev/null
@@ -1,18 +0,0 @@
-# TODO: Improve docs: What is the accepted time format?
-# TODO: Make Date version.
-earliest_time
-EarliestTime
-String
-Sets the earliest time for which to display the scheduled times for scheduled searches (not just the next run time).
--
-The earliest time.
-===
-# TODO: Improve docs: What is the accepted time format?
-# TODO: Make Date version.
-latest_time
-LatestTime
-String
-Sets the latest time until which to display the scheduled times for scheduled searches (not just the next run time).
--
-The latest time.
-===
diff --git a/argsGenerator/specs/SavedSearchDispatchArgs__POST_saved_searches_NAME_dispatch.argspec b/argsGenerator/specs/SavedSearchDispatchArgs__POST_saved_searches_NAME_dispatch.argspec
deleted file mode 100644
index f4056f22..00000000
--- a/argsGenerator/specs/SavedSearchDispatchArgs__POST_saved_searches_NAME_dispatch.argspec
+++ /dev/null
@@ -1,129 +0,0 @@
-# TODO: Improve docs: What is the accepted time format?
-# TODO: Make Date version.
-dispatch.now
-DispatchNow
-String
-Sets a time that dispatches the search as though the specified time were the current time.
--
-A string with the specified time.
-===
-dispatch.buckets
-DispatchBuckets
-int
-Sets the maximum number of timeline buckets.
--
-The maximum number of timeline buckets.
-===
-dispatch.earliest_time
-DispatchEarliestTime
-String
-Specifies the earliest time for this search. This value can be a relative or absolute time. If this value is an absolute time, use {@link #setDispatchTimeFormat} to format the value.
--
-A time string that specifies the earliest time for this search.
-===
-dispatch.earliest_time
-DispatchEarliestTime
-Date
-Sets the earliest time for this search.
--
-A date that specifies the earliest time for this search.
-!CODE
- // Documented format: "%FT%T.%Q%:z"
- // strftime original format: "%FT%T.%Q%:z"
- // strftime expanded format: "%Y-%m-%dT%H:%M:%S.%Q%:z"
- String javaFormatString = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
- String timeString = new SimpleDateFormat(javaFormatString).format(dispatchEarliestTime);
- this.put("dispatch.earliest_time", timeString);
-===
-dispatch.latest_time
-DispatchLatestTime
-String
-Specifies the latest time for this search. This value can be a relative or absolute time. If this value is an absolute time, use {@link #setDispatchTimeFormat} to format the value.
--
-A time string that specifies the latest time for this search.
-===
-dispatch.latest_time
-DispatchLatestTime
-Date
-Sets the latest time for this search.
--
-A date that specifies the latest time for this saved search.
-!CODE
- // Documented format: "%FT%T.%Q%:z"
- // strftime original format: "%FT%T.%Q%:z"
- // strftime expanded format: "%Y-%m-%dT%H:%M:%S.%Q%:z"
- String javaFormatString = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
- String timeString = new SimpleDateFormat(javaFormatString).format(dispatchLatestTime);
- this.put("dispatch.latest_time", timeString);
-===
-dispatch.lookups
-DispatchLookups
-boolean
-Indicates whether to enable lookups for this search.
--
-{@code true} to enable lookups, {@code false} if not.
-===
-dispatch.max_count
-DispatchMaximumCount
-int
-Sets the maximum number of results before finalizing the search.
--
-The maximum number of results.
-===
-dispatch.max_time
-DispatchMaximumTime
-int
-Sets the the maximum amount of time before finalizing the search.
--
-The maximum amount of time, in seconds.
-===
-dispatch.reduce_freq
-DispatchReduceFrequency
-int
-Set the frequency for how often Splunk should run the MapReduce reduce phase on accumulated map values.
--
-The frequency, in seconds.
-===
-dispatch.rt_backfill
-DispatchRealTimeBackfill
-boolean
-Indicates whether to back fill the real-time window for this search. This value only applies to real-time searches.
--
-{@code true} to back fill the real-time window, {@code false} if not.
-===
-dispatch.spawn_process
-DispatchSpawnProcess
-boolean
-Indicates whether the search should run in a separate spawned process. Searches against indexes must run in a separate process.
--
-{@code true} to run the search in a separate process, {@code false} if not.
-===
-dispatch.time_format
-DispatchTimeFormat
-String
-Sets a time format for Splunk to use to specify the earliest and latest times.
--
-A time format string.
-===
-dispatch.ttl
-# The TTL acronym is not expanded here to be consistent with Job.getTtl
-DispatchTtl
-String
-Indicates the time to live (TTL) for the artifacts of the scheduled search, if no actions are triggered. If an action is triggered, Splunk changes the TTL to that action's TTL. If multiple actions are triggered, Splunk applies the maximum TTL to the artifacts. To set the action's TTL, refer to alert_actions.conf.spec.
--
-The time to live, in seconds. If the value is a number followed by "p", it is the number of scheduled search periods.
-===
-trigger_actions
-TriggerActions
-boolean
-Indicates whether to trigger alert actions.
--
-{@code true} to trigger alert actions, {@code false} if not.
-===
-force_dispatch
-ForceDispatch
-boolean
-Indicates whether to start a new search, even if another instance of this search is already running.
--
-{@code true} to start a new search, {@code false} if not.
-===
diff --git a/deploy b/deploy
deleted file mode 100755
index ab8acd24..00000000
--- a/deploy
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-
-declare -r scriptDirectory="$(dirname $(readlink -e $0))"
-declare -r scriptName="$(basename $0)"
-declare -r version="1.9.5"
-
-if [[ $# -ne 1 ]]; then
- echo 1>&2 "Usage: ${scriptName} {local|staging||production}"
-fi
-
-case $1 in
-local)
- declare -r url="file:///${HOME}/.m2/repository/"
- declare -r repositoryId=""
- ;;
-staging)
- declare -r url="http://stg-artifactory:8081/artifactory/devplat-staging/"
- declare -r repositoryId="splunk-staging-artifactory"
- ;;
-production)
- declare -r url="https://splunk.artifactoryonline.com/splunk/ext-releases-local/"
- declare -r repositoryId="splunk-production-artifactory"
- ;;
-esac
-
-cd "${scriptDirectory}"
-
-mvn deploy:deploy-file -Ddescription="The Splunk SDK for Java" -Dfile=dist/splunk-${version}.jar \
- -DgroupId=com.splunk -DartifactId=splunk -Dversion=${version}.0 -Dpackaging=jar \
- -Djavadoc=dist/splunk-${version}-javadoc.jar \
- -Dsources=dist/splunk-${version}-sources.jar \
- -DrepositoryId="${repositoryId}" \
- -DupdateReleaseInfo=true \
- -Durl="${url}"
diff --git a/deploy.md b/deploy.md
deleted file mode 100644
index aed545f5..00000000
--- a/deploy.md
+++ /dev/null
@@ -1,38 +0,0 @@
-##NAME
-
-deploy - Transmit splunk-sdk-java artifacts to the local, staging or production
-maven artifact repository
-
-##SYNOPSIS
-
-deploy \
-
-##DESCRIPTION
-
-Deploy transmits **target/splunk-1.9.5.jar**, **target/splunk-1.9.5-javadoc.jar**, and
-**target/splunk-1.9.5-sources.jar** to the **local**, **staging**, or **production**
-maven repository. Repository names are mapped to locations as follows.
-
-| repository-name | location |
-|-----------------|----------------------------------------------------------------|
-| local | file:///${HOME}/.m2/repository/ |
-| staging | http://stg-artifactory:8081/artifactory/devplat-staging/ | |
-| production | https://splunk.jfrog.io/artifactory/ext-releases-local/ |
-
-After deployment you should find this tree structure at the location of your repository
-
- com/splunk/splunk/1.9.5/
- ├── splunk-1.9.5-javadoc.jar
- ├── splunk-1.9.5-javadoc.jar.md5
- ├── splunk-1.9.5-javadoc.jar.sha1
- ├── splunk-1.9.5-sources.jar
- ├── splunk-1.9.5-sources.jar.md5
- ├── splunk-1.9.5-sources.jar.sha1
- ├── splunk-1.9.5.jar
- ├── splunk-1.9.5.jar.md5
- ├── splunk-1.9.5.jar.sha1
- ├── splunk-1.9.5.pom
- ├── splunk-1.9.5.pom.md5
- └── splunk-1.9.5.pom.sha1
-
-Verify this structure prior to release.
diff --git a/docker-compose.yml b/docker-compose.yml
deleted file mode 100644
index 4584c6d3..00000000
--- a/docker-compose.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-version: '3.6'
-
-services:
- splunk:
- image: "splunk/splunk:latest"
- container_name: splunk
- environment:
- - SPLUNK_START_ARGS=--accept-license
- - SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113
- - SPLUNK_PASSWORD=changed!
- - SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.1.0/sdkappcollection.tgz
- - JAVA_VERSION=openjdk:8
- ports:
- - 8000:8000
- - 8088:8088
- - 8089:8089
- - 10667:10667
- - 10668:10668/udp
- healthcheck:
- test: ['CMD', 'curl', '-f', 'http://localhost:8000']
- interval: 5s
- timeout: 5s
- retries: 20
diff --git a/examples/examples.iml b/examples/examples.iml
deleted file mode 100644
index a8093d19..00000000
--- a/examples/examples.iml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/pom.xml b/examples/pom.xml
deleted file mode 100644
index 18bbb711..00000000
--- a/examples/pom.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
- 4.0.0
-
- examples
-
- splunk-sdk-java
- com.splunk
- 1.0.1
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 3.0.0-M5
-
- true
-
-
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
- 3.0.0-M1
-
- true
-
-
-
-
-
-
-
- com.splunk
- splunk
- 1.9.5
- provided
-
-
- org.netbeans.api
- org-openide-util-lookup
- RELEASE124
-
-
- org.netbeans.api
- org-openide-util
- RELEASE124
-
-
- org.netbeans.api
- org-openide-filesystems
- RELEASE124
-
-
- org.netbeans.api
- org-openide-awt
- RELEASE124
-
-
- org.netbeans.api
- org-openide-dialogs
- RELEASE124
-
-
- org.netbeans.api
- org-openide-nodes
- RELEASE124
-
-
- org.netbeans.api
- org-openide-explorer
- RELEASE124
-
-
- org.netbeans.api
- org-openide-execution
- RELEASE124
-
-
- org.netbeans.api
- org-openide-modules
- RELEASE124
-
-
- org.netbeans.api
- org-openide-windows
- RELEASE124
-
-
- org.netbeans.api
- org-openide-text
- RELEASE124
-
-
- org.netbeans.api
- org-openide-options
- RELEASE124
-
-
- org.netbeans.api
- org-openide-loaders
- RELEASE124
-
-
- org.netbeans.api
- org-openide-io
- RELEASE124
-
-
- org.netbeans.api
- org-openide-actions
- RELEASE124
-
-
-
-
diff --git a/examples/src/main/java/com/splunk/examples/endpoint_instantiation/Program.java b/examples/src/main/java/com/splunk/examples/endpoint_instantiation/Program.java
deleted file mode 100644
index 8cb24f5e..00000000
--- a/examples/src/main/java/com/splunk/examples/endpoint_instantiation/Program.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2015 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.endpoint_instantiation;
-
-import com.splunk.*;
-
-/**
- * This example shows how to access any Splunk REST API endpoint.
- * Here, we are just getting an EntityCollection of Entity objects representing
- * apps on the Splunk server.
- *
- * You can also write a class which inherits from the Entity class.
- * A minimal example of this is:
- *
- * public class MyEntity extends Entity {
- * MyEntity(Service service, String path) {
- * super(service, path);
- * }
- * }
- *
- * Then, you can write a class which inherits from the EntityCollection class.
- * A minimal example of this is:
- *
- * public class MyEntityCollection extends EntityCollection {
- * MyEntityCollection(Service service) {
- * super(service, "path/hardcoded", MyEntity.class, new Args());
- * }
- * }
- */
-
-public class Program {
- public static void main(String[] args) {
- Command command = Command.splunk("info").parse(args);
- Service service = Service.connect(command.opts);
-
- String mySplunkRESTPath = "apps/local";
-
- EntityCollection myCollection = new EntityCollection(service, mySplunkRESTPath, Entity.class, new Args());
-
- System.out.println("Found " + myCollection.size() + " Splunk apps:");
-
- for (Object myEntity : myCollection.values()) {
- Entity entity = (Entity) myEntity;
- System.out.println("\t" + entity.getName());
- }
- }
-}
\ No newline at end of file
diff --git a/examples/src/main/java/com/splunk/examples/explorer/AppNode.java b/examples/src/main/java/com/splunk/examples/explorer/AppNode.java
deleted file mode 100644
index 50caaffc..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/AppNode.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Application;
-import com.splunk.Entity;
-
-class AppNode extends EntityNode {
- public AppNode(Entity value) {
- super(value);
- Application app = (Application)value;
- String displayName = app.getLabel();
- if (displayName == null) displayName = app.getName();
- setDisplayName(displayName);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(boolean.class, "getCheckForUpdates");
- list.add(String.class, "getLabel");
- list.add(String.class, "getVersion");
- list.add(boolean.class, "isConfigured");
- list.add(boolean.class, "isManageable");
- list.add(boolean.class, "isVisible");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/ConfCollectionKids.java b/examples/src/main/java/com/splunk/examples/explorer/ConfCollectionKids.java
deleted file mode 100644
index c7549f47..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/ConfCollectionKids.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.ConfCollection;
-import com.splunk.Entity;
-import com.splunk.EntityCollection;
-
-import java.util.Collection;
-import org.openide.nodes.Children;
-import org.openide.nodes.Node;
-
-class ConfCollectionKids extends Children.Keys {
- ConfCollection confs;
-
- ConfCollectionKids(ConfCollection confs) {
- this.confs = confs;
- }
-
- @Override protected void addNotify() {
- Collection> values = confs.values();
- setKeys(values);
- }
-
- @Override protected Node[] createNodes(EntityCollection conf) {
- return new Node[] {
- new EntityCollectionNode(conf.getTitle(), conf, StanzaNode.class)
- };
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/ConfCollectionNode.java b/examples/src/main/java/com/splunk/examples/explorer/ConfCollectionNode.java
deleted file mode 100644
index 1f1b9e44..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/ConfCollectionNode.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.ConfCollection;
-
-// UNDONE: Some duplication of EntityConnectionNode below, eg: title count
-// and size property - could probably be refactored into a shared
-// CollectionNode base class.
-class ConfCollectionNode extends ResourceNode {
- ConfCollectionNode(ConfCollection value) {
- super(value, new ConfCollectionKids(value));
- setDisplayName(String.format("Configuration (%d)", value.size()));
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(int.class, "size");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/DatePropertyEditor.java b/examples/src/main/java/com/splunk/examples/explorer/DatePropertyEditor.java
deleted file mode 100644
index d73dbaca..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/DatePropertyEditor.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import java.beans.PropertyEditorSupport;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-public class DatePropertyEditor extends PropertyEditorSupport {
- static String datePattern = "MM/dd/yyyy HH:mm:ss";
- static SimpleDateFormat dateFormat = new SimpleDateFormat(datePattern);
-
- @Override public String getAsText() {
- Date value = (Date)getValue();
- if (value == null) return "null";
- return dateFormat.format(value);
- }
-
- @Override public void setAsText(String value) {
- try {
- setValue(dateFormat.parse(value));
- }
- catch (ParseException e) {
- throw new IllegalArgumentException("Invalid date format");
- }
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/DeploymentClientNode.java b/examples/src/main/java/com/splunk/examples/explorer/DeploymentClientNode.java
deleted file mode 100644
index b0255ecd..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/DeploymentClientNode.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class DeploymentClientNode extends EntityNode {
- DeploymentClientNode(Entity value) {
- super(value);
- setDisplayName("Deployment Client");
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getTargetUri");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/DeploymentServerClassNode.java b/examples/src/main/java/com/splunk/examples/explorer/DeploymentServerClassNode.java
deleted file mode 100644
index 8c5733df..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/DeploymentServerClassNode.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class DeploymentServerClassNode extends EntityNode {
- DeploymentServerClassNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getBlackList");
- list.add(String.class, "getBlackListDot");
- list.add(String.class, "getBlackList0");
- list.add(String.class, "getBlackList1");
- list.add(String.class, "getBlackList2");
- list.add(String.class, "getBlackList3");
- list.add(String.class, "getBlackList4");
- list.add(String.class, "getBlackList5");
- list.add(String.class, "getBlackList6");
- list.add(String.class, "getBlackList7");
- list.add(String.class, "getBlackList8");
- list.add(String.class, "getBlackList9");
- list.add(boolean.class, "getContinueMatching");
- list.add(String.class, "getEndpoint");
- list.add(String.class, "getFilterType");
- list.add(String.class, "getRepositoryLocation");
- list.add(String.class, "getTargetRepositoryLocation");
- list.add(String.class, "getTmpFolder");
- list.add(String.class, "getWhiteList");
- list.add(String.class, "getWhiteListDot");
- list.add(String.class, "getWhiteList0");
- list.add(String.class, "getWhiteList1");
- list.add(String.class, "getWhiteList2");
- list.add(String.class, "getWhiteList3");
- list.add(String.class, "getWhiteList4");
- list.add(String.class, "getWhiteList5");
- list.add(String.class, "getWhiteList6");
- list.add(String.class, "getWhiteList7");
- list.add(String.class, "getWhiteList8");
- list.add(String.class, "getWhiteList9");
- return list;
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/DeploymentServerNode.java b/examples/src/main/java/com/splunk/examples/explorer/DeploymentServerNode.java
deleted file mode 100644
index 79e33e78..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/DeploymentServerNode.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class DeploymentServerNode extends EntityNode {
- DeploymentServerNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(boolean.class, "getCheckNew");
- list.add(String.class, "getWhiteList0");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/DeploymentTenantNode.java b/examples/src/main/java/com/splunk/examples/explorer/DeploymentTenantNode.java
deleted file mode 100644
index 48c14259..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/DeploymentTenantNode.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class DeploymentTenantNode extends EntityNode {
- DeploymentTenantNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- return new PropertyList() {{
- add(boolean.class, "getCheckNew");
- add(String.class, "getWhiteList0");
- }};
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/DistributedConfigurationNode.java b/examples/src/main/java/com/splunk/examples/explorer/DistributedConfigurationNode.java
deleted file mode 100644
index 73c2cec8..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/DistributedConfigurationNode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class DistributedConfigurationNode extends EntityNode {
- DistributedConfigurationNode(Entity value) {
- super(value);
- setDisplayName("Distributed Configuration");
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(boolean.class, "getAutoAddServers");
- list.add(String[].class, "getBlacklistNames");
- list.add(String[].class, "getBlacklistUrls");
- list.add(int.class, "getCheckTimedOutServersFrequency");
- list.add(int.class, "getHeartbeatFrequency");
- list.add(String.class, "getHeartbeatMcastAddress");
- list.add(int.class, "getHeartbeatPort");
- list.add(boolean.class, "getRemovedTimedOutServers");
- list.add(int.class, "getServerTimeout");
- list.add(String.class, "getServers");
- list.add(boolean.class, "getShareBundles");
- list.add(boolean.class, "getSkipOurselves");
- list.add(int.class, "getStatusTimeout");
- list.add(int.class, "getTtl");
- list.add(boolean.class, "isDisabled");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/DistributedPeerNode.java b/examples/src/main/java/com/splunk/examples/explorer/DistributedPeerNode.java
deleted file mode 100644
index 9139d601..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/DistributedPeerNode.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class DistributedPeerNode extends EntityNode {
- DistributedPeerNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String[].class, "getBundleVersions");
- list.add(String.class, "getGuid");
- list.add(String.class, "getLicenseSignature");
- list.add(String.class, "getPeerName");
- list.add(String.class, "getPeerType");
- list.add(String.class, "getReplicationStatus");
- list.add(String.class, "getStatus");
- list.add(String.class, "getVersion");
- list.add(boolean.class, "isDisabled");
- list.add(boolean.class, "isHttps");
- return list;
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/EntityCollectionNode.java b/examples/src/main/java/com/splunk/examples/explorer/EntityCollectionNode.java
deleted file mode 100644
index 92819273..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/EntityCollectionNode.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-import com.splunk.EntityCollection;
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import org.openide.nodes.Children;
-import org.openide.nodes.Node;
-
-// Abstract class that generalizes an explorer node for any EntityCollection
-class EntityCollectionNode extends ResourceNode {
- Class itemClass;
- Constructor itemCtor = null;
-
- static EntityComparator comparator = new EntityComparator();
-
- EntityCollectionNode(String title, EntityCollection value, Class itemClass)
- {
- super(value, Children.LEAF);
- this.itemClass = itemClass;
- setDisplayName(String.format("%s (%d)", title, value.size()));
- setChildren(new EntityCollectionKids(this));
- }
-
- Node createKid(Entity entity) {
- try {
- if (itemCtor == null)
- itemCtor = itemClass.getDeclaredConstructor(Entity.class);
- return (Node)itemCtor.newInstance(entity);
- }
- catch (Exception e) {
- throw new RuntimeException(e.getMessage(), e);
- }
- }
-
- EntityCollection getCollection() {
- return (EntityCollection)this.value;
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(int.class, "size");
- return list;
- }
-
- class EntityCollectionKids extends Children.Keys {
- EntityCollectionNode parent;
-
- EntityCollectionKids(EntityCollectionNode parent) {
- this.parent = parent;
- }
-
- @Override protected void addNotify() {
- Collection values = parent.getCollection().values();
- List list = new ArrayList(values);
- Collections.sort(list, comparator);
- setKeys(list);
- }
-
- @Override protected Node[] createNodes(Entity entity) {
- return new Node[] { parent.createKid(entity) };
- }
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/EntityComparator.java b/examples/src/main/java/com/splunk/examples/explorer/EntityComparator.java
deleted file mode 100644
index 8547fa9f..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/EntityComparator.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-import java.util.Comparator;
-
-class EntityComparator implements Comparator {
- public int compare(Entity entity1, Entity entity2) {
- return entity1.getName().compareTo(entity2.getName());
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/EntityKids.java b/examples/src/main/java/com/splunk/examples/explorer/EntityKids.java
deleted file mode 100644
index a1776980..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/EntityKids.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-import com.splunk.EntityMetadata;
-
-import org.openide.nodes.Children;
-import org.openide.nodes.Node;
-
-class EntityKids extends Children.Keys {
- Entity entity;
-
- EntityKids(Entity entity) {
- this.entity = entity;
- }
-
- @Override protected void addNotify() {
- EntityMetadata metadata = entity.getMetadata();
- if (metadata == null) return;
- setKeys(new EntityMetadata[] { metadata });
- }
-
- @Override protected Node[] createNodes(EntityMetadata metadata) {
- return new Node[] { new EntityMetadataNode(metadata) };
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/EntityMetadataNode.java b/examples/src/main/java/com/splunk/examples/explorer/EntityMetadataNode.java
deleted file mode 100644
index 9e07beb2..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/EntityMetadataNode.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.EntityMetadata;
-
-import java.util.Map;
-
-class EntityMetadataNode extends ExplorerNode {
- EntityMetadataNode(EntityMetadata value) {
- super(value);
- setDisplayName("Metadata");
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(boolean.class, "canChangePermissions");
- list.add(boolean.class, "canShareApp");
- list.add(boolean.class, "canShareGlobal");
- list.add(boolean.class, "canShareUser");
- list.add(boolean.class, "canWrite");
- list.add(String.class, "getApp");
- list.add(String.class, "getOwner");
- list.add(Map.class, "getPermissions");
- list.add(String.class, "getSharing");
- list.add(boolean.class, "isModifiable");
- return list;
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/EntityNode.java b/examples/src/main/java/com/splunk/examples/explorer/EntityNode.java
deleted file mode 100644
index 1d6262d9..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/EntityNode.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class EntityNode extends ResourceNode {
- EntityNode(Entity value) {
- super(value, new EntityKids(value));
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/EventTypeNode.java b/examples/src/main/java/com/splunk/examples/explorer/EventTypeNode.java
deleted file mode 100644
index 943b179c..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/EventTypeNode.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class EventTypeNode extends EntityNode {
- EventTypeNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getDescriptionLabel");
- list.add(int.class, "getPriority");
- list.add(String.class, "getSearch");
- return list;
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/Explorer.java b/examples/src/main/java/com/splunk/examples/explorer/Explorer.java
deleted file mode 100644
index 82a4ccef..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/Explorer.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-//
-// The NetBeans tutorial on which this sample is based:
-//
-// http://blogs.oracle.com/geertjan/entry/netbeans_apis_outside_of_the
-//
-
-package com.splunk.examples.explorer;
-
-import com.splunk.InputKind;
-import com.splunk.Service;
-
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.beans.PropertyEditorManager;
-import java.util.Date;
-import java.util.Map;
-import javax.swing.JFrame;
-import javax.swing.JSplitPane;
-import org.openide.explorer.ExplorerManager;
-import org.openide.explorer.propertysheet.PropertySheetView;
-import org.openide.explorer.view.BeanTreeView;
-import org.openide.nodes.AbstractNode;
-import org.openide.nodes.Children;
-import org.openide.nodes.Node;
-
-public class Explorer extends JFrame implements ExplorerManager.Provider {
- private ExplorerManager manager;
- private Children.Array roots;
-
- static {
- // Register property editors for types that dont have a default editor.
- PropertyEditorManager.registerEditor(
- Date.class, DatePropertyEditor.class);
- PropertyEditorManager.registerEditor(
- InputKind.class, InputKindPropertyEditor.class);
- PropertyEditorManager.registerEditor(
- Map.class, MapPropertyEditor.class);
- PropertyEditorManager.registerEditor(
- String[].class, StringArrayPropertyEditor.class);
- }
-
- Explorer(Service service) {
- this.roots = new Children.Array();
- roots.add(new Node[] { new ServiceNode(service) });
- Node root = new AbstractNode(roots);
- root.setDisplayName("Root"); // Not visible
- this.manager = new ExplorerManager();
- this.manager.setRootContext(root);
- initialize();
- }
-
- public static Explorer create(Service service) {
- return new Explorer(service);
- }
-
- public ExplorerManager getExplorerManager() {
- return this.manager;
- }
-
- void initialize() {
- BeanTreeView left;
- left = new BeanTreeView();
- left.setRootVisible(false);
-
- PropertySheetView right;
- right = new PropertySheetView();
- right.setDescriptionAreaVisible(false);
-
- JSplitPane splitPane;
- splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, left, right);
- splitPane.setResizeWeight(0.4);
- splitPane.setDividerSize(3);
-
- setTitle("Splunk Explorer");
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- getContentPane().add(splitPane);
-
- // Place the window in a convenient position
- Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
- int width = screenSize.width / 2;
- int height = screenSize.height / 2;
- setSize(width, height);
- setLocation(width / 2, height / 2);
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/ExplorerNode.java b/examples/src/main/java/com/splunk/examples/explorer/ExplorerNode.java
deleted file mode 100644
index 27478991..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/ExplorerNode.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import org.openide.nodes.AbstractNode;
-import org.openide.nodes.Children;
-import org.openide.nodes.Sheet;
-
-// Abstract node that simplifies the creation of node metadata.
-class ExplorerNode extends AbstractNode {
- Object value;
-
- ExplorerNode(Object value) {
- super(Children.LEAF);
- this.value = value;
- }
-
- ExplorerNode(Object value, Children kids) {
- super(kids);
- this.value = value;
- }
-
- protected PropertyList getMetadata() {
- return new PropertyList();
- }
-
- @Override protected Sheet createSheet() {
- return getMetadata().createSheet(value);
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/GroupNode.java b/examples/src/main/java/com/splunk/examples/explorer/GroupNode.java
deleted file mode 100644
index bd143ea2..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/GroupNode.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import org.openide.nodes.AbstractNode;
-import org.openide.nodes.Children;
-import org.openide.nodes.Node;
-
-// A simple named container node.
-class GroupNode extends AbstractNode {
- GroupNode(String name, final Node... kids) {
- super(Children.LEAF);
- setDisplayName(name);
- setChildren(new Children.Array() {{ add(kids); }});
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/IndexNode.java b/examples/src/main/java/com/splunk/examples/explorer/IndexNode.java
deleted file mode 100644
index b9a73a2a..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/IndexNode.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-import java.util.Date;
-
-class IndexNode extends EntityNode {
- IndexNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(boolean.class, "getAssureUTF8");
- list.add(int.class, "getBlockSignSize");
- list.add(String.class, "getBlockSignatureDatabase");
- list.add(String.class, "getColdPath");
- list.add(String.class, "getColdPathExpanded");
- list.add(String.class, "getColdToFrozenDir");
- list.add(String.class, "getColdToFrozenScript");
- list.add(boolean.class, "getCompressRawdata");
- list.add(int.class, "getCurrentDBSizeMB");
- list.add(String.class, "getDefaultDatabase");
- list.add(boolean.class, "getEnableRealtimeSearch");
- list.add(int.class, "getFrozenTimePeriodInSecs");
- list.add(String.class, "getHomePath");
- list.add(String.class, "getHomePathExpanded");
- list.add(String.class, "getIndexThreads");
- list.add(String.class, "getLastInitTime");
- list.add(int.class, "getMaxConcurrentOptimizes");
- list.add(String.class, "getMaxDataSize");
- list.add(int.class, "getMaxHotBuckets");
- list.add(int.class, "getMaxHotIdleSecs");
- list.add(int.class, "getMaxHotIdleSecs");
- list.add(int.class, "getMaxHotSpanSecs");
- list.add(int.class, "getMaxMemMB");
- list.add(int.class, "getMaxMetaEntries");
- list.add(int.class, "getMaxRunningProcessGroups");
- list.add(Date.class, "getMaxTime");
- list.add(int.class, "getMaxTotalDataSizeMB");
- list.add(int.class, "getMaxWarmDBCount");
- list.add(int.class, "getMemPoolMB");
- list.add(String.class, "getMinRawFileSyncSecs");
- list.add(Date.class, "getMinTime");
- list.add(int.class, "getPartialServiceMetaPeriod");
- list.add(int.class, "getQuarantineFutureSecs");
- list.add(int.class, "getQuarantinePastSecs");
- list.add(int.class, "getRawChunkSizeBytes");
- list.add(int.class, "getRotatePeriodInSecs");
- list.add(int.class, "getServiceMetaPeriod");
- list.add(String.class, "getSuppressBannerList");
- list.add(boolean.class, "getSync");
- list.add(boolean.class, "getSyncMeta");
- list.add(String.class, "getThawedPath");
- list.add(String.class, "getThawedPathExpanded");
- list.add(int.class, "getThrottleCheckPeriod");
- list.add(int.class, "getTotalEventCount");
- list.add(boolean.class, "isDisabled");
- list.add(boolean.class, "isInternal");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/InputKindPropertyEditor.java b/examples/src/main/java/com/splunk/examples/explorer/InputKindPropertyEditor.java
deleted file mode 100644
index 599cf351..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/InputKindPropertyEditor.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.InputKind;
-
-import java.beans.PropertyEditorSupport;
-
-public class InputKindPropertyEditor extends PropertyEditorSupport {
- @Override public String getAsText() {
- InputKind value = (InputKind)getValue();
- return value.toString();
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/InputNode.java b/examples/src/main/java/com/splunk/examples/explorer/InputNode.java
deleted file mode 100644
index d440e815..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/InputNode.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-import com.splunk.Input;
-import com.splunk.InputKind;
-
-class InputNode extends EntityNode {
- InputNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(InputKind.class, "getKind");
- Input input = (Input)value;
- InputKind kind = input.getKind();
- if (kind == InputKind.Monitor) {
- list.add(int.class, "getFileCount");
- list.add(String.class, "getHost");
- list.add(String.class, "getIndex");
- list.add(int.class, "getRcvBuf");
- } else if (kind == InputKind.Script) {
- list.add(String.class, "getGroup");
- list.add(String.class, "getHost");
- list.add(String.class, "getIndex");
- list.add(int.class, "getInterval");
- list.add(int.class, "getRcvBuf");
- } else if (kind == InputKind.Tcp) {
- list.add(String.class, "getGroup");
- list.add(String.class, "getHost");
- list.add(String.class, "getIndex");
- list.add(int.class, "getRcvBuf");
- list.add(String.class, "getRestrictToHost");
- } else if (kind == InputKind.TcpSplunk || kind == InputKind.Udp) {
- list.add(String.class, "getGroup");
- list.add(String.class, "getHost");
- list.add(String.class, "getIndex");
- list.add(int.class, "getRcvBuf");
- } else if (kind == InputKind.WindowsActiveDirectory) {
- list.add(String.class, "getIndex");
- list.add(boolean.class, "getMonitorSubtree");
- } else if (kind == InputKind.WindowsEventLog) {
- list.add(String.class, "getHosts");
- list.add(String.class, "getIndex");
- list.add(String[].class, "getLogs");
- list.add(String.class, "getLocalName");
- list.add(String.class, "getLookupHost");
- } else if (kind == InputKind.WindowsPerfmon) {
- list.add(String.class, "getIndex");
- list.add(String[].class, "getInstances");
- list.add(int.class, "getInterval");
- list.add(String.class, "getObject");
- } else if (kind == InputKind.WindowsRegistry) {
- list.add(boolean.class, "getBaseline");
- list.add(String.class, "getProc");
- list.add(String.class, "getHive");
- list.add(String.class, "getIndex");
- list.add(boolean.class, "getMonitorSubnoes");
- list.add(String.class, "getType");
- } else if (kind == InputKind.WindowsWmi) {
- list.add(String.class, "getClasses");
- list.add(String[].class, "getFields");
- list.add(String.class, "getIndex");
- list.add(String[].class, "getInstances");
- list.add(int.class, "getInterval");
- list.add(String.class, "getLookupHost");
- list.add(String.class, "getLocalName");
- list.add(String.class, "getServer");
- list.add(String.class, "getWq1");
- }
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/JobNode.java b/examples/src/main/java/com/splunk/examples/explorer/JobNode.java
deleted file mode 100644
index 0e56742a..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/JobNode.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-import com.splunk.Job;
-
-import java.util.Date;
-
-class JobNode extends EntityNode {
- JobNode(Entity value) {
- super(value);
- Job job = (Job)value;
- setDisplayName(job.getTitle());
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(Date.class, "getCursorTime");
- list.add(String.class, "getDelegate");
- list.add(int.class, "getDiskUsage");
- list.add(String.class, "getDispatchState");
- list.add(float.class, "getDoneProgress");
- list.add(int.class, "getDropCount");
- list.add(Date.class, "getEarliestTime");
- list.add(int.class, "getEventAvailableCount");
- list.add(int.class, "getEventCount");
- list.add(int.class, "getEventFieldCount");
- list.add(boolean.class, "getEventIsStreaming");
- list.add(boolean.class, "getEventIsTruncated");
- list.add(String.class, "getEventSearch");
- list.add(String.class, "getEventSorting");
- list.add(String.class, "getKeywords");
- list.add(String.class, "getLabel");
- list.add(Date.class, "getLatestTime");
- list.add(int.class, "getNumPreviews");
- list.add(int.class, "getPriority");
- list.add(String.class, "getRemoteSearch");
- list.add(String.class, "getReportSearch");
- list.add(int.class, "getResultCount");
- list.add(boolean.class, "getResultIsStreaming");
- list.add(int.class, "getResultPreviewCount");
- list.add(float.class, "getRunDuration");
- list.add(int.class, "getScanCount");
- list.add(String.class, "getSearch");
- list.add(String.class, "getSearchLatestTime");
- list.add(String.class, "getSid");
- list.add(int.class, "getStatusBuckets");
- list.add(int.class, "getTtl");
- list.add(boolean.class, "isDone");
- list.add(boolean.class, "isFailed");
- list.add(boolean.class, "isFinalized");
- list.add(boolean.class, "isPaused");
- list.add(boolean.class, "isPreviewEnabled");
- list.add(boolean.class, "isRemoteTimeline");
- list.add(boolean.class, "isSaved");
- list.add(boolean.class, "isSavedSearch");
- list.add(boolean.class, "isZombie");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/LicenseGroupNode.java b/examples/src/main/java/com/splunk/examples/explorer/LicenseGroupNode.java
deleted file mode 100644
index 06421e98..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/LicenseGroupNode.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class LicenseGroupNode extends EntityNode {
- LicenseGroupNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String[].class, "getStackIds");
- list.add(boolean.class, "isActive");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/LicenseNode.java b/examples/src/main/java/com/splunk/examples/explorer/LicenseNode.java
deleted file mode 100644
index aadf356c..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/LicenseNode.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-import com.splunk.License;
-
-import java.util.Date;
-
-class LicenseNode extends EntityNode {
- LicenseNode(Entity value) {
- super(value);
- License license = (License)value;
- String displayName = license.getLabel();
- if (displayName == null) displayName = license.getName();
- setDisplayName(displayName);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(Date.class, "getCreationTime");
- list.add(Date.class, "getExpirationTime");
- list.add(String[].class, "getFeatures");
- list.add(String.class, "getGroupId");
- list.add(String.class, "getLabel");
- list.add(String.class, "getLicenseHash");
- list.add(int.class, "getMaxViolations");
- list.add(long.class, "getQuota");
- list.add(String[].class, "getSourceTypes");
- list.add(String.class, "getStackId");
- list.add(String.class, "getStatus");
- list.add(String.class, "getType");
- list.add(int.class, "getWindowPeriod");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/LicensePoolNode.java b/examples/src/main/java/com/splunk/examples/explorer/LicensePoolNode.java
deleted file mode 100644
index 1849d269..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/LicensePoolNode.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class LicensePoolNode extends EntityNode {
- LicensePoolNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getDescriptionLabel");
- list.add(long.class, "getQuota");
- list.add(String[].class, "getSlaves");
- list.add(long.class, "getSlavesUsageBytes");
- list.add(String.class, "getStackId");
- list.add(long.class, "getUsedBytes");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/LicenseSlaveNode.java b/examples/src/main/java/com/splunk/examples/explorer/LicenseSlaveNode.java
deleted file mode 100644
index 3340b2c7..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/LicenseSlaveNode.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class LicenseSlaveNode extends EntityNode {
- LicenseSlaveNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getLabel");
- list.add(String[].class, "getPoolIds");
- list.add(String[].class, "getStackIds");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/LicenseStackNode.java b/examples/src/main/java/com/splunk/examples/explorer/LicenseStackNode.java
deleted file mode 100644
index 743b84dd..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/LicenseStackNode.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class LicenseStackNode extends EntityNode {
- LicenseStackNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getLabel");
- list.add(long.class, "getQuota");
- list.add(String.class, "getType");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/LoggerNode.java b/examples/src/main/java/com/splunk/examples/explorer/LoggerNode.java
deleted file mode 100644
index 4c563ddd..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/LoggerNode.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class LoggerNode extends EntityNode {
- LoggerNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getLevel");
- return list;
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/MapPropertyEditor.java b/examples/src/main/java/com/splunk/examples/explorer/MapPropertyEditor.java
deleted file mode 100644
index 30f81036..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/MapPropertyEditor.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import java.beans.PropertyEditorSupport;
-import java.util.Map;
-
-public class MapPropertyEditor extends PropertyEditorSupport {
- @Override public String getAsText() {
- Map value = (Map)getValue();
- return value.toString();
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/MessageNode.java b/examples/src/main/java/com/splunk/examples/explorer/MessageNode.java
deleted file mode 100644
index be756267..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/MessageNode.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class MessageNode extends EntityNode {
- MessageNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getKey");
- list.add(String.class, "getValue");
- return list;
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/NamespaceKids.java b/examples/src/main/java/com/splunk/examples/explorer/NamespaceKids.java
deleted file mode 100644
index f9c76609..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/NamespaceKids.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Service;
-
-import org.openide.nodes.Children;
-import org.openide.nodes.Node;
-
-class NamespaceKids extends Children.Keys {
- Service service;
-
- NamespaceKids(Service service) {
- this.service = service;
- }
-
- @Override protected void addNotify() {
- String[] kinds = new String[] {
- "confs",
- "eventtypes",
- "searches",
- "jobs",
- };
- setKeys(kinds);
- }
-
- private Node createNode(String kind) {
- if (kind.equals("confs"))
- return new ConfCollectionNode(service.getConfs());
-
- if (kind.equals("eventtypes"))
- return new EntityCollectionNode(
- "EventTypes",
- service.getEventTypes(),
- EventTypeNode.class);
-
- if (kind.equals("jobs"))
- return new EntityCollectionNode(
- "Jobs",
- service.getJobs(),
- JobNode.class);
-
- if (kind.equals("searches"))
- return new EntityCollectionNode(
- "Saved Searches",
- service.getSavedSearches(),
- SavedSearchNode.class);
-
- return null;
- }
-
- @Override protected Node[] createNodes(String kind) {
- return new Node[] { createNode(kind) };
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/NamespacesKids.java b/examples/src/main/java/com/splunk/examples/explorer/NamespacesKids.java
deleted file mode 100644
index 5fba807d..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/NamespacesKids.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Args;
-import com.splunk.Service;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import org.openide.nodes.AbstractNode;
-import org.openide.nodes.Children;
-import org.openide.nodes.Node;
-
-class NamespacesKids extends Children.Keys {
- Service service;
-
- NamespacesKids(Service service) {
- this.service = service;
- }
-
- @Override protected void addNotify() {
- Set names = service.getApplications().keySet();
- int count = 3 + names.size();
- List keys = new ArrayList(count);
- keys.add("");
- keys.add("");
- keys.add("");
- keys.addAll(names);
- Collections.sort(keys, String.CASE_INSENSITIVE_ORDER);
- setKeys(keys.toArray(new String[count]));
- }
-
- private Node createNode(String name) {
-
- if (name.equals(""))
- return createNode("", "-");
-
- if (name.equals(""))
- return createNode("", "-");
- // UNDONE: return new GLobalNamespaceNode()
-
- if (name.equals(""))
- return createNode("", "system");
-
- if (service.getApplications().get(name).isDisabled()) {
- Node node = new AbstractNode(Children.LEAF);
- node.setDisplayName(name);
- return node;
- }
-
- return createNode(name, name);
- }
-
- private Node createNode(String displayName, String app) {
- // Clone the root service, scoped to the requested namespace
- Args args = new Args();
- args.put("host", service.getHost());
- args.put("port", service.getPort());
- args.put("scheme", service.getScheme());
- args.put("username", service.getUsername());
- args.put("password", service.getPassword());
- args.put("app", app);
- args.put("owner", "-");
- Service scope = Service.connect(args);
-
- Node node = new ExplorerNode(scope, new NamespaceKids(scope));
- node.setDisplayName(displayName);
- return node;
- }
-
- @Override protected Node[] createNodes(String kind) {
- return new Node[] { createNode(kind) };
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/NamespacesNode.java b/examples/src/main/java/com/splunk/examples/explorer/NamespacesNode.java
deleted file mode 100644
index 5a240f7a..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/NamespacesNode.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Service;
-
-class NamespacesNode extends ExplorerNode {
- NamespacesNode(Service service) {
- super(service, new NamespacesKids(service));
- setDisplayName("Namespaces");
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/OutputDefaultNode.java b/examples/src/main/java/com/splunk/examples/explorer/OutputDefaultNode.java
deleted file mode 100644
index 8cd65130..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/OutputDefaultNode.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class OutputDefaultNode extends EntityNode {
- OutputDefaultNode(Entity value) {
- super(value);
- setDisplayName("Output Default");
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(boolean.class, "autoLb");
- list.add(boolean.class, "blockOnCloning");
- list.add(boolean.class, "blockOnQueueFull");
- list.add(int.class, "getAutoLbFrequency");
- list.add(int.class, "getConnectionTimeout");
- list.add(String.class, "getDefaultGroup");
- list.add(int.class, "getDropClonedEventsOnQueueFull");
- list.add(int.class, "getDropEventsOnQueueFull");
- list.add(String.class, "getForwardedIndex0Whitelist");
- list.add(String.class, "getForwardedIndex1Blacklist");
- list.add(String.class, "getForwardedIndex2Whitelist");
- list.add(int.class, "getHeartbeatFrequency");
- list.add(int.class, "getMaxConnectionsPerIndexer");
- list.add(int.class, "getMaxFailuresPerInterval");
- list.add(long.class, "getMaxQueueSize");
- list.add(int.class, "getReadTimeout");
- list.add(int.class, "getSecsInFailureInterval");
- list.add(int.class, "getWriteTimeout");
- list.add(boolean.class, "indexAndForward");
- list.add(boolean.class, "isCompressed");
- list.add(boolean.class, "isDisabled");
- list.add(boolean.class, "isForwardedIndexFilterDisable");
- list.add(boolean.class, "isIndexAndForward");
- list.add(boolean.class, "sendCookedData");
- list.add(boolean.class, "useAck");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/OutputGroupNode.java b/examples/src/main/java/com/splunk/examples/explorer/OutputGroupNode.java
deleted file mode 100644
index 657aa7ba..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/OutputGroupNode.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class OutputGroupNode extends EntityNode {
- OutputGroupNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getMethod");
- list.add(String[].class, "getServers");
- list.add(boolean.class, "isDisabled");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/OutputServerNode.java b/examples/src/main/java/com/splunk/examples/explorer/OutputServerNode.java
deleted file mode 100644
index 94c86388..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/OutputServerNode.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class OutputServerNode extends EntityNode {
- OutputServerNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- // UNDONE list.add(Connections[], "allConnections");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/OutputSyslogNode.java b/examples/src/main/java/com/splunk/examples/explorer/OutputSyslogNode.java
deleted file mode 100644
index c5b05b92..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/OutputSyslogNode.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class OutputSyslogNode extends EntityNode {
- OutputSyslogNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getServer");
- list.add(String.class, "getType");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/PasswordNode.java b/examples/src/main/java/com/splunk/examples/explorer/PasswordNode.java
deleted file mode 100644
index 4b03f427..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/PasswordNode.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class PasswordNode extends EntityNode {
- PasswordNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getClearPassword");
- list.add(String.class, "getEncryptedPassword");
- list.add(String.class, "getPassword");
- list.add(String.class, "getRealm");
- list.add(String.class, "getUsername");
- return list;
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/Program.java b/examples/src/main/java/com/splunk/examples/explorer/Program.java
deleted file mode 100644
index 025b8194..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/Program.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Service;
-import com.splunk.Command;
-
-import javax.swing.SwingUtilities;
-
-public class Program {
- public static void main(final String[] args) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- Command command = Command.splunk("explorer").parse(args);
- Service service = Service.connect(command.opts);
- Explorer.create(service).setVisible(true);
- }
- });
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/PropertyInfo.java b/examples/src/main/java/com/splunk/examples/explorer/PropertyInfo.java
deleted file mode 100644
index 1989ae93..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/PropertyInfo.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-public class PropertyInfo {
- public Class datatype;
- public String getter;
- public String setter;
-
- public PropertyInfo(Class datatype, String getter, String setter) {
- this.datatype = datatype;
- this.getter = getter;
- this.setter = setter;
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/PropertyList.java b/examples/src/main/java/com/splunk/examples/explorer/PropertyList.java
deleted file mode 100644
index 1981ed03..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/PropertyList.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import java.util.ArrayList;
-import org.openide.nodes.PropertySupport;
-import org.openide.nodes.Sheet;
-
-public class PropertyList extends ArrayList {
- public void add(Class datatype, String getter) {
- add(datatype, getter, null);
- }
-
- public void add(Class datatype, String getter, String setter) {
- add(new PropertyInfo(datatype, getter, setter));
- }
-
- public Sheet createSheet(Object object) {
- Sheet sheet = Sheet.createDefault();
- Sheet.Set props = Sheet.createPropertiesSet();
- try {
- for (PropertyInfo info : this) {
- props.put(new PropertySupport.Reflection(
- object, info.datatype, info.getter, info.setter));
- }
- }
- catch (NoSuchMethodException e) {
- throw new RuntimeException(e.getMessage(), e);
- }
- sheet.put(props);
- return sheet;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/ResourceNode.java b/examples/src/main/java/com/splunk/examples/explorer/ResourceNode.java
deleted file mode 100644
index 2f579df9..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/ResourceNode.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Resource;
-
-import org.openide.nodes.Children;
-
-class ResourceNode extends ExplorerNode {
- ResourceNode(Resource value) {
- super(value);
- setDisplayName(value.getName());
- }
-
- ResourceNode(Resource value, Children kids) {
- super(value, kids);
- setDisplayName(value.getName());
- }
-
- @Override protected PropertyList getMetadata() {
- return new PropertyList() {{
- add(String.class, "getPath");
- add(String.class, "getTitle");
- }};
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/RoleNode.java b/examples/src/main/java/com/splunk/examples/explorer/RoleNode.java
deleted file mode 100644
index f810c3a3..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/RoleNode.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class RoleNode extends EntityNode {
- RoleNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String[].class, "getCapabilities");
- list.add(String.class, "getDefaultApp");
- list.add(String[].class, "getImportedCapabilities");
- list.add(String[].class, "getImportedRoles");
- list.add(int.class, "getImportedRtSearchJobsQuota");
- list.add(int.class, "getImportedSearchDiskQuota");
- list.add(String.class, "getImportedSearchFilter");
- list.add(String[].class, "getImportedIndexesAllowed");
- list.add(String[].class, "getImportedIndexesDefault");
- list.add(int.class, "getImportedSearchJobsQuota");
- list.add(int.class, "getRtSearchJobsQuota");
- list.add(int.class, "getSearchDiskQuota");
- list.add(String.class, "getSearchFilter");
- list.add(String[].class, "getSearchIndexesAllowed");
- list.add(String[].class, "getSearchIndexesDefault");
- list.add(int.class, "getSearchJobsQuota");
- list.add(int.class, "getSearchTimeWin");
- return list;
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/SavedSearchNode.java b/examples/src/main/java/com/splunk/examples/explorer/SavedSearchNode.java
deleted file mode 100644
index a042bc62..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/SavedSearchNode.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class SavedSearchNode extends EntityNode {
- SavedSearchNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getActionEmailSendResults");
- list.add(String.class, "getActionEmailTo");
- list.add(String.class, "getAlertExpires");
- list.add(int.class, "getAlertSeverity");
- list.add(String.class, "getAlertSuppress");
- list.add(String.class, "getAlertSuppressPeriod");
- list.add(String.class, "getAlertTrack");
- list.add(String.class, "getAlertComparator");
- list.add(String.class, "getAlertCondition");
- list.add(String.class, "getAlertThreshold");
- list.add(String.class, "getAlertType");
- list.add(String.class, "getCronSchedule");
- list.add(String.class, "getDescriptionLabel");
- list.add(int.class, "getDispatchBuckets");
- list.add(String.class, "getDispatchEarliestTime");
- list.add(String.class, "getDispatchLatestTime");
- list.add(boolean.class, "getDispatchLookups");
- list.add(int.class, "getDispatchMaxCount");
- list.add(String.class, "getDispatchMaxTime");
- list.add(int.class, "getDispatchReduceFreq");
- list.add(boolean.class, "getDispatchSpawnProcess");
- list.add(String.class, "getDispatchTimeFormat");
- list.add(String.class, "getDispatchTtl");
- list.add(String.class, "getDisplayView");
- list.add(int.class, "getMaxConcurrent");
- list.add(String.class, "getNextScheduledTime");
- list.add(String.class, "getQualifiedSearch");
- list.add(boolean.class, "getRealtimeSchedule");
- list.add(String.class, "getRequestUiDispatchApp");
- list.add(String.class, "getRequestUiDispatchView");
- list.add(boolean.class, "getRestartOnSearchPeerAdd");
- list.add(boolean.class, "getRunOnStartup");
- list.add(String.class, "getSearch");
- list.add(String.class, "getVsid");
- list.add(boolean.class, "isActionEmail");
- list.add(boolean.class, "isActionPopulateLookup");
- list.add(boolean.class, "isActionRss");
- list.add(boolean.class, "isActionScript");
- list.add(boolean.class, "isActionSummaryIndex");
- list.add(boolean.class, "isDigestMode");
- list.add(boolean.class, "isDisabled");
- list.add(boolean.class, "isScheduled");
- list.add(boolean.class, "isVisible");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/ServiceKids.java b/examples/src/main/java/com/splunk/examples/explorer/ServiceKids.java
deleted file mode 100644
index 216dd6bc..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/ServiceKids.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Service;
-
-import org.openide.nodes.Children;
-import org.openide.nodes.Node;
-
-class ServiceKids extends Children.Keys {
- Service service;
-
- ServiceKids(Service service) {
- this.service = service;
- }
-
- @Override protected void addNotify() {
- String[] kinds = new String[] {
- "system",
- "indexes",
- "inputs",
- "outputs",
- "namespaces",
- };
- setKeys(kinds);
- }
-
- private Node createNode(String kind) {
- if (kind.equals("indexes"))
- return new EntityCollectionNode(
- "Indexes",
- service.getIndexes(),
- IndexNode.class);
-
- if (kind.equals("inputs"))
- return new EntityCollectionNode(
- "Inputs",
- service.getInputs(),
- InputNode.class);
-
- if (kind.equals("namespaces"))
- return new NamespacesNode(service);
-
- if (kind.equals("outputs"))
- return new GroupNode(
- "Outputs",
- new OutputDefaultNode(service.getOutputDefault()),
- new EntityCollectionNode(
- "Output Groups",
- service.getOutputGroups(),
- OutputGroupNode.class),
- new EntityCollectionNode(
- "Output Servers",
- service.getOutputServers(),
- OutputServerNode.class),
- new EntityCollectionNode(
- "Output Syslogs",
- service.getOutputSyslogs(),
- OutputSyslogNode.class));
-
- if (kind.equals("system"))
- return new GroupNode(
- "System",
- new SettingsNode(service.getSettings()),
- new EntityCollectionNode(
- "Loggers", service.getLoggers(), LoggerNode.class),
- new EntityCollectionNode(
- "Messages", service.getMessages(), MessageNode.class),
- new GroupNode(
- "Deployment",
- new DistributedConfigurationNode(
- service.getDistributedConfiguration()),
- new EntityCollectionNode(
- "Distributed Peers",
- service.getDistributedPeers(),
- DistributedPeerNode.class),
- new DeploymentClientNode(
- service.getDeploymentClient()),
- new EntityCollectionNode(
- "Deployment Servers",
- service.getDeploymentServers(),
- DeploymentServerNode.class),
- new EntityCollectionNode(
- "Deployment Server Classes",
- service.getDeploymentServerClasses(),
- DeploymentServerClassNode.class),
- new EntityCollectionNode(
- "Deployment Tenants",
- service.getDeploymentTenants(),
- DeploymentTenantNode.class)),
- new GroupNode(
- "Licensing",
- new EntityCollectionNode(
- "Licenses",
- service.getLicenses(),
- LicenseNode.class),
- new EntityCollectionNode(
- "License Pools",
- service.getLicensePools(),
- LicensePoolNode.class),
- new EntityCollectionNode(
- "License Groups",
- service.getLicenseGroups(),
- LicenseGroupNode.class),
- new EntityCollectionNode(
- "License Slaves",
- service.getLicenseSlaves(),
- LicenseSlaveNode.class),
- new EntityCollectionNode(
- "License Stacks",
- service.getLicenseStacks(),
- LicenseStackNode.class)),
- new EntityCollectionNode(
- "Roles", service.getRoles(), RoleNode.class),
- new EntityCollectionNode(
- "Users", service.getUsers(), UserNode.class));
-
- return null;
- }
-
- @Override protected Node[] createNodes(String kind) {
- return new Node[] { createNode(kind) };
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/ServiceNode.java b/examples/src/main/java/com/splunk/examples/explorer/ServiceNode.java
deleted file mode 100644
index 2c80c86b..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/ServiceNode.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Service;
-
-class ServiceNode extends ExplorerNode {
- ServiceNode(Service service) {
- super(service.getInfo(), new ServiceKids(service));
- setDisplayName(service.getInfo().getServerName());
- }
-
- @Override protected PropertyList getMetadata() {
- return new PropertyList() {{
- add(int.class, "getBuild");
- add(String.class, "getCpuArch");
- add(String[].class, "getLicenseKeys");
- add(String.class, "getLicenseSignature");
- add(String.class, "getLicenseState");
- add(String.class, "getMasterGuid");
- add(String.class, "getMode");
- add(String.class, "getOsBuild");
- add(String.class, "getOsVersion");
- add(String.class, "getServerName");
- add(String.class, "getVersion");
- add(boolean.class, "isFree");
- add(boolean.class, "isTrial");
- }};
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/SettingsNode.java b/examples/src/main/java/com/splunk/examples/explorer/SettingsNode.java
deleted file mode 100644
index f6cfc105..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/SettingsNode.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class SettingsNode extends EntityNode {
- SettingsNode(Entity value) {
- super(value);
- setDisplayName("Settings");
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getSplunkDB");
- list.add(String.class, "getSplunkHome");
- list.add(boolean.class, "getEnableSplunkWebSSL");
- list.add(String.class, "getHost");
- list.add(int.class, "getHttpPort");
- list.add(int.class, "getMgmtPort");
- list.add(int.class, "getMinFreeSpace");
- list.add(String.class, "getPass4SymmKey");
- list.add(String.class, "getServerName");
- list.add(String.class, "getSessionTimeout");
- list.add(boolean.class, "getStartWebServer");
- list.add(String.class, "getTrustedIP");
- return list;
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/explorer/StanzaNode.java b/examples/src/main/java/com/splunk/examples/explorer/StanzaNode.java
deleted file mode 100644
index c5dc0753..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/StanzaNode.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-import org.openide.nodes.PropertySupport;
-import org.openide.nodes.Sheet;
-
-class StanzaNode extends EntityNode {
- StanzaNode(Entity value) {
- super(value);
- setDisplayName(value.getName());
- }
-
- // Implement createSheet directly in order to dynamically construct
- // based on the contents of the stanza.
- @Override protected Sheet createSheet() {
- Entity entity = (Entity)value;
- Sheet.Set props = Sheet.createPropertiesSet();
- for (String key : entity.keySet()) {
- if (key.equals("eai:acl") || key.equals("eai:attributes"))
- continue;
- props.put(new StanzaProperty(entity, key));
- }
- Sheet sheet = Sheet.createDefault();
- sheet.put(props);
- return sheet;
- }
-
- // This should never be called because we implement createSheet directly.
- @Override protected PropertyList getMetadata() {
- throw new UnsupportedOperationException();
- }
-
- class StanzaProperty extends PropertySupport.ReadOnly {
- private String key;
- private Entity stanza;
-
- StanzaProperty(Entity stanza, String key) {
- super(key, String.class, key, null);
- this.key = key;
- this.stanza = stanza;
- }
-
- @Override public String getValue() {
- return (String)stanza.get(key);
- }
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/StringArrayPropertyEditor.java b/examples/src/main/java/com/splunk/examples/explorer/StringArrayPropertyEditor.java
deleted file mode 100644
index 82c642d4..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/StringArrayPropertyEditor.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import java.beans.PropertyEditorSupport;
-import java.util.Arrays;
-
-public class StringArrayPropertyEditor extends PropertyEditorSupport {
- @Override public String getAsText() {
- String[] value = (String[])getValue();
- if (value == null) return "null";
- return Arrays.toString(value);
- }
-
- @Override public void setAsText(String value) {
- throw new UnsupportedOperationException();
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/explorer/UserNode.java b/examples/src/main/java/com/splunk/examples/explorer/UserNode.java
deleted file mode 100644
index a9f807f4..00000000
--- a/examples/src/main/java/com/splunk/examples/explorer/UserNode.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.explorer;
-
-import com.splunk.Entity;
-
-class UserNode extends EntityNode {
- UserNode(Entity value) {
- super(value);
- }
-
- @Override protected PropertyList getMetadata() {
- PropertyList list = super.getMetadata();
- list.add(String.class, "getDefaultApp");
- list.add(boolean.class, "getDefaultAppIsUserOverride");
- list.add(String.class, "getDefaultAppSourceRole");
- list.add(String.class, "getEmail");
- list.add(String.class, "getPassword");
- list.add(String.class, "getRealName");
- list.add(String[].class, "getRoles");
- return list;
- }
-}
-
diff --git a/examples/src/main/java/com/splunk/examples/export/Program.java b/examples/src/main/java/com/splunk/examples/export/Program.java
deleted file mode 100644
index 55b298f1..00000000
--- a/examples/src/main/java/com/splunk/examples/export/Program.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.export;
-
-import com.splunk.*;
-
-import java.nio.channels.FileChannel;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.RandomAccessFile;
-import java.io.Writer;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Export.java: export an splunk entire index in XML, CSV or JSON (4.3+). The
- * return data is in strict descending time order.
- */
-
-// In recover mode, we will duplicate messages and meta data; however,
-// this is not necessarily incorrect, just redundant information.
-
-public class Program {
-
- static String lastTime;
- static int nextEventOffset;
-
- static public void main(String[] args) {
- try {
- run(args);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- static Map getStartNextCSVEvent(int location, String str) {
-
- Map pair = new HashMap();
- pair.put("start", -1);
- pair.put("end", -1);
-
- int eventStart = str.indexOf("\n", location) + 1;
- int eventEnd = str.indexOf("\"\n", eventStart + 1);
-
- while (eventEnd > 0) {
- String substring = str.substring(eventStart, eventEnd);
- String [] parts = substring.split(",");
- // Test parts 0 and 1 of the CSV, for and time.qqq stamp
- try {
- Integer.parseInt(parts[0]);
- String timestamp = parts[1].replace("\"","");
- String [] timeparts = timestamp.split("\\.");
- Integer.parseInt(timeparts[0]);
- Integer.parseInt(timeparts[1]);
- pair.put("start", eventStart);
- pair.put("end", eventEnd);
- return pair;
- }
- catch (Exception e) {
- // If any of the fields accessed caused an exception, then
- // we didn't have a valid start of event, so try again.
- eventStart = str.indexOf("\n", eventEnd + 2);
- eventEnd = str.indexOf("\"\n", eventStart + 1);
- }
- }
- return pair;
- }
-
- static int getCsvEventStart(String str) {
-
- Mappair = getStartNextCSVEvent(0, str);
- if (pair.get("start")< 0)
- return -1;
-
- lastTime = str.substring(pair.get("start"))
- .split(",")[1]
- .replace("\"","");
- nextEventOffset = pair.get("end");
-
- // Walk through events until time changes.
- while (pair.get("end") > 0) {
- pair = getStartNextCSVEvent(pair.get("start"), str);
- if (pair.get("end") < 0)
- return -1;
- String time = str.substring(pair.get("start"), pair.get("end"))
- .split(",")[1]
- .replace("\"", "");
- if (!time.equals(lastTime)) {
- return pair.get("start");
- }
- nextEventOffset = pair.get("end") + 1;
- }
-
- return -1;
- }
-
- static int getXmlEventStart(String str) {
- String resultPattern = "";
- String timeStartPattern = "";
- String timeEndPattern = "<";
- String eventEndPattern = "";
-
- // Get first event in this buffer. If no event end kick back
- int eventStart = str.indexOf(resultPattern);
- int eventEnd = str.indexOf(eventEndPattern, eventStart)
- + eventEndPattern.length();
- if (eventEnd < 0)
- return -1;
- int timeKeyStart = str.indexOf(timeKeyPattern, eventStart);
- int timeStart = str.indexOf(timeStartPattern, timeKeyStart)
- + timeStartPattern.length();
- int timeEnd = str.indexOf(timeEndPattern, timeStart+1);
- lastTime = str.substring(timeStart, timeEnd);
-
- nextEventOffset = eventEnd;
-
- // Walk through events until time changes
- eventStart = eventEnd;
- while (eventEnd > 0) {
- eventStart = str.indexOf(resultPattern, eventStart+1);
- eventEnd = str.indexOf(eventEndPattern, eventStart)
- + eventEndPattern.length();
- if (eventEnd < 0)
- return -1;
- timeKeyStart = str.indexOf(timeKeyPattern, eventStart);
- timeStart = str.indexOf(timeStartPattern, timeKeyStart);
- timeEnd = str.indexOf(timeEndPattern, timeStart);
- String time = str.substring(timeStart, timeEnd);
- if (!time.equals(lastTime)) {
- return eventStart;
- }
- nextEventOffset = eventEnd;
- eventStart = eventEnd;
- }
-
- return -1;
- }
-
- static int getJsonEventStart(String str) {
-
- String timeKeyPattern = "\"_time\":\"";
- String timeEndPattern = "\"";
- String eventEndPattern = "\"},\n";
- String eventEndPattern2 = "\"}[]"; // Old json output format bug
-
- // Get first event in this buffer. If no event end kick back.
- int eventStart = str.indexOf("{\"_cd\":\"");
- int eventEnd = str.indexOf(eventEndPattern, eventStart)
- + eventEndPattern.length();
- if (eventEnd < 0)
- eventEnd = str.indexOf(eventEndPattern2, eventStart)
- + eventEndPattern2.length();
- if (eventEnd < 0)
- return -1;
-
- int timeStart = str.indexOf(timeKeyPattern, eventStart)
- + timeKeyPattern.length();
- int timeEnd = str.indexOf(timeEndPattern, timeStart+1);
- lastTime = str.substring(timeStart, timeEnd);
- nextEventOffset = eventEnd;
-
- // Walk through events until time changes.
- eventStart = eventEnd;
- while (eventEnd > 0) {
- eventStart = str.indexOf("{\"_cd\":\"", eventStart+1);
- eventEnd = str.indexOf(eventEndPattern, eventStart)
- + eventEndPattern.length();
- if (eventEnd < 0)
- eventEnd = str.indexOf(eventEndPattern2, eventStart)
- + eventEndPattern2.length();
- if (eventEnd < 0)
- return -1;
-
- timeStart = str.indexOf(timeKeyPattern, eventStart)
- + timeKeyPattern.length();
- timeEnd = str.indexOf(timeEndPattern, timeStart+1);
- String time = str.substring(timeStart, timeEnd);
- if (!time.equals(lastTime)) {
- return eventStart;
- }
- nextEventOffset = eventEnd-2;
- eventStart = eventEnd;
- }
-
- return -1;
- }
-
- static int getEventStart(byte[] buffer, String format)
- throws Exception {
-
- String str = new String(buffer);
- if (format.equals("csv"))
- return getCsvEventStart(str);
- else if (format.equals("xml"))
- return getXmlEventStart(str);
- else
- return getJsonEventStart(str);
- }
-
- static void cleanupTail(Writer out, String format) throws Exception {
- if (format.equals("csv"))
- out.write("\n");
- else if (format.equals("xml"))
- out.write("\n\n");
- else
- out.write("\n]\n");
- }
-
- static void run(String[] argv) throws Exception {
- Command command = Command.splunk("export");
- command.addRule("search", String.class, "Search string to export");
-
- command.parse(argv);
- Service service = Service.connect(command.opts);
-
- Args args = new Args();
- final String outFilename = "export.out";
- boolean recover = false;
- boolean addEndOfLine = false;
- String format = "csv"; // default to csv
-
- // This example takes optional arguments:
- //
- // index-name [recover] [csv|xml|json]
- //
- // N.B. json output only valid with 4.3+
-
- String indexName = null;
- if (command.args.length == 0) {
- System.out.println("Exporting main index");
- indexName = "main";
- } else
- indexName = command.args[0];
-
- if (command.args.length > 1) {
- for (int index=1; index < command.args.length; index++) {
- if (command.args[index].equals("recover"))
- recover = true;
- else if (command.args[index].equals("csv"))
- format = "csv";
- else if (command.args[index].equals("xml"))
- format = "xml";
- else if (command.args[index].equals("json"))
- format = "json";
- else
- throw new Error("Unknown option: " + command.args[index]);
- }
- }
-
- File file = new File(outFilename);
- if (file.exists() && file.isFile() && !recover)
- throw new Error("Export file exists, and no recover option");
-
- if (recover && file.exists() && file.isFile()) {
- // Chunk backwards through the file until we find valid
- // start time. If we can't find one just start over.
- final int bufferSize = (64*1024);
- RandomAccessFile raf = new RandomAccessFile(file, "rw");
- long fptr = Math.max(file.length() - bufferSize, 0);
- long fptrEof = 0;
-
- while (fptr > 0) {
- byte [] buffer = new byte[bufferSize];
- raf.seek(fptr);
- raf.read(buffer, 0, bufferSize);
- int eventStart = getEventStart(buffer, format);
- if (eventStart != -1) {
- fptrEof = nextEventOffset + fptr;
- break;
- }
- fptr = fptr - bufferSize;
- }
-
- if (fptr < 0)
- fptrEof = 0; // We didn't find a valid event, so start over.
- else
- args.put("latest_time", lastTime);
- addEndOfLine = true;
-
- FileChannel fc = raf.getChannel();
- fc.truncate(fptrEof);
- } else
- if (!file.createNewFile())
- throw new Error("Failed to create output file");
-
- // Search args
- args.put("timeout", "60"); // Don't keep search around
- args.put("output_mode", format); // Output in specific format
- args.put("earliest_time", "0.000"); // Always to beginning of index
- args.put("time_format", "%s.%Q"); // Epoch time plus fraction
- String search = null;
-
- if (command.opts.containsKey("search")) {
- search = (String)command.opts.get("search");
- }
- else {
- search = String.format("search index=%s *", indexName);
- }
-
- InputStream is = service.export(search, args);
-
- // Use UTF8 sensitive reader/writers
- InputStreamReader isr = new InputStreamReader(is, "UTF-8");
- FileOutputStream os = new FileOutputStream(file, true);
- Writer out = new OutputStreamWriter(os, "UTF-8");
-
- // Read/write 8k at a time if possible
- char [] xferBuffer = new char[8192];
- boolean once = true;
-
- // If superfluous meta-data is not needed, or specifically
- // wants to be removed, one would clean up the first read
- // buffer on a format by format basis,
- while (true) {
- if (addEndOfLine && once) {
- cleanupTail(out, format);
- once = false;
- }
- int bytesRead = isr.read(xferBuffer);
- if (bytesRead == -1) break;
- out.write(xferBuffer, 0, bytesRead);
- }
-
- isr.close();
- out.close();
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/fluent_pivot/Program.java b/examples/src/main/java/com/splunk/examples/fluent_pivot/Program.java
deleted file mode 100644
index 79b70bf0..00000000
--- a/examples/src/main/java/com/splunk/examples/fluent_pivot/Program.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package com.splunk.examples.fluent_pivot;
-
-import com.splunk.*;
-
-public class Program {
- public static void main(String[] argv) {
- try {
- run(argv);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- static void run(String[] argsIn) throws Exception {
- Command command;
- Service service;
-
- command = Command.splunk("input");
- service = Service.connect(command.opts);
-
- DataModel dataModel = service.getDataModels().get("internal_audit_logs");
- DataModelObject searches = dataModel.getObject("searches");
-
- System.out.print("Working with object " + searches.getDisplayName());
- System.out.println(" in model " + dataModel.getDisplayName());
- System.out.print(" Lineage: ");
- for (String name : searches.getLineage()) {
- System.out.print(" -> " + name);
- }
- System.out.println();
- System.out.println(" Internal name: " + searches.getName());
-
- Job firstFiveEntries = searches.runQuery("| head 5");
- while (!firstFiveEntries.isDone()) {
- Thread.sleep(100);
- }
-
- ResultsReaderXml results = new ResultsReaderXml(firstFiveEntries.getResults());
- for (Event event : results) {
- System.out.println(event.toString());
- }
-
- System.out.println("~~~~~~~~~~~~~~~~~~~~");
- System.out.println("Pivoting on searches");
-
- Pivot pivot = searches.createPivotSpecification().
- addRowSplit("user", "Executing user").
- addColumnSplit("exec_time", null, null, null, 4).
- addCellValue("search", "Search Query", StatsFunction.DISTINCT_VALUES).
- pivot();
-
- System.out.println("Query for binning search queries by execution time and executing user:");
- System.out.println(" " + pivot.getPrettyQuery());
-
- Job pivotJob = pivot.run();
- while (!pivotJob.isDone()) {
- Thread.sleep(100);
- }
-
- results = new ResultsReaderXml(pivotJob.getResults());
- for (Event event : results) {
- System.out.println(event.toString());
- }
- }
-}
-
-
diff --git a/examples/src/main/java/com/splunk/examples/genevents/Program.java b/examples/src/main/java/com/splunk/examples/genevents/Program.java
deleted file mode 100644
index 247e1a30..00000000
--- a/examples/src/main/java/com/splunk/examples/genevents/Program.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.genevents;
-
-import com.splunk.*;
-
-import java.io.*;
-import java.net.Socket;
-import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-
-/**
- * Generate events into an index using either stream, submit or raw tcp
- * methods.
- */
-
-public class Program {
-
- static String indexName =
- "Name of index to send events to. If unspecified, 'default' is used";
- static int ingestPort = 9002;
- static String ingestMethod =
- "Ingest events via method {stream, submit, tcp} (default: stream)";
- static String tcpPort =
- String.format("Input port for tcp ingest (default: %d)", ingestPort);
- static SimpleDateFormat dateFormat =
- new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
-
- public static void main(String[] args) {
- try {
- run(args);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- static String makeEvent(String stamp, int i, int j) {
- return String.format("%s: event bunch %d, number %d\n", stamp, i, j);
- }
-
- static void buildRules(Command command, String[] argsIn) {
- command.addRule("index", String.class, indexName);
- command.addRule("itype", String.class, ingestMethod);
- command.addRule("iport", String.class, tcpPort);
- command.parse(argsIn);
- }
-
- static void run(String[] argsIn) throws Exception {
-
- Command command;
- int count;
- Index index = null;
- String ingest;
- String iname;
- List ingestTypes = Arrays.asList("submit", "stream", "tcp");
- OutputStream ostream;
- Receiver receiver = null;
- Service service;
- Socket stream = null;
- Writer writerOut = null;
-
- command = Command.splunk("genevents");
- buildRules(command, argsIn);
- service = Service.connect(command.opts);
-
- // Determine ingest method and other input arguments.
- iname = null;
- ingest = "stream";
- if (command.opts.containsKey("index")) {
- iname = (String)command.opts.get("index");
- }
- if (command.opts.containsKey("itype"))
- ingest = (String)command.opts.get("itype");
- if (command.opts.containsKey("iport")) {
- ingestPort = Integer.parseInt((String)command.opts.get("iport"));
- }
-
- // Validate
- if (!ingestTypes.contains(ingest)) {
- Command.error("Method '"+ingest+"' must be in set: "+ingestTypes);
- }
-
- if (iname != null) {
- index = service.getIndexes().get(iname);
- if (index == null) {
- Command.error("Index '" + iname + "' was not found.");
- }
- } else {
- receiver = service.getReceiver();
- }
-
-
- // For stream and tcp, they both require a socket, though setup
- // slightly differently.
- if (ingest.equals("stream") || ingest.equals("tcp")) {
- if (ingest.equals("stream"))
- try {
- // A specific index or not?
- if (iname != null)
- stream = index.attach();
- else
- stream = receiver.attach();
- }
- catch (NullPointerException e) {
- System.out.println("Failed to attach to index.");
- System.exit(3);
- }
- else {
- // Create a tcp input if one does not already exist.
- String inputName = String.valueOf(ingestPort);
- TcpInput tcpInput = (TcpInput)service.getInputs().get(inputName);
- if (tcpInput == null) {
- tcpInput = (TcpInput)service.getInputs().create(
- inputName, InputKind.Tcp);
- }
- stream = tcpInput.attach();
- }
- ostream = stream.getOutputStream();
- writerOut = new OutputStreamWriter(ostream, "UTF-8");
- }
-
- // Generate 10 batches of 5000 events each.
- count = 0;
- for (int i=0; i<10; i++) {
- for (int j=0; j<5000; j++) {
- Date date = new Date();
- String lastEvent = makeEvent(dateFormat.format(date), i, j);
- if (ingest.equals("stream") || ingest.equals("tcp"))
- writerOut.write(lastEvent);
- else
- if (iname != null)
- index.submit(lastEvent);
- else
- receiver.submit(lastEvent);
- count++;
- }
- System.out.println("Submitted "+count+" events, using "+ingest);
- }
-
- // Flush and close stream on completion
- if (ingest.equals("stream") || ingest.equals("tcp")) {
- writerOut.flush();
- writerOut.close();
- stream.close();
- }
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/get_job/Program.java b/examples/src/main/java/com/splunk/examples/get_job/Program.java
deleted file mode 100644
index 3656ed1d..00000000
--- a/examples/src/main/java/com/splunk/examples/get_job/Program.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2015 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.get_job;
-
-import com.splunk.*;
-
-/**
- * This example shows a better way to retrieve a Job by its sid
- * using the new getJob() method.
- *
- * Previously, the only way to do this would be the following:
- *
- * Job job = service.getJobs().get(sid);
- *
- * The above has a significant overhead of getting all search jobs from
- * the Splunk REST API in order to get a single Job.
- *
- */
-
-public class Program {
- public static void main(String[] args) {
- Command command = Command.splunk("info").parse(args);
- Service service = Service.connect(command.opts);
-
- String sid = service.search("search index=_internal | head 5").getSid();
- Job job = service.getJob(sid);
-
- while (!job.isDone()) {
- job.refresh();
- try {
- Thread.sleep(1000);
- } catch (Exception e) {
- System.out.println(e.getMessage());
- }
- }
-
- System.out.println("Number of events found: " + job.getEventCount());
- }
-}
\ No newline at end of file
diff --git a/examples/src/main/java/com/splunk/examples/index/Program.java b/examples/src/main/java/com/splunk/examples/index/Program.java
deleted file mode 100644
index d3761d54..00000000
--- a/examples/src/main/java/com/splunk/examples/index/Program.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.index;
-
-import com.splunk.EntityCollection;
-import com.splunk.Index;
-import com.splunk.Service;
-import com.splunk.Command;
-import com.splunk.SplunkException;
-
-public class Program {
- private static void list(Service service) {
- EntityCollection indexes = service.getIndexes();
- for (Index entity: indexes.values()) {
- System.out.println(
- entity.getTitle() +
- " (" + entity.get("totalEventCount") + ")");
- }
- }
-
- public static void main(String[] args) {
- Command command = Command.splunk("index").parse(args);
- Service service = Service.connect(command.opts);
-
- // This example takes optional arguments:
- // [action index-name]
- //
- // without cli arguments, all indexes and their totalEventCount
- // is displayed
-
- if (command.args.length == 0) {
- list(service);
- return;
- }
-
- if (command.args.length != 2)
- Command.error("Action and index-name required");
-
- String action = command.args[0];
- String name = command.args[1];
-
- EntityCollection indexes = service.getIndexes();
- if (action.equals("create")) {
- if (indexes.containsKey(name))
- Command.error("Index " + name + " already exists");
- indexes.create(name);
- return;
- }
-
- Index index = indexes.get(name);
- if (index == null)
- Command.error("Index '" + name + "' does not exists");
-
- if (action.equals("clean")) {
- try {
- index.clean(180); // Timeout after 3 minutes.
- } catch (SplunkException e) {
- if (e.getCode() == SplunkException.INTERRUPTED) {
- // User pressed Ctrl-C
- return;
- } else {
- throw e;
- }
- }
- }
- else if (action.equals("disable"))
- index.disable();
- else if (action.equals("enable"))
- index.enable();
- else
- Command.error("Unknown action '" + action + "'");
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/info/Program.java b/examples/src/main/java/com/splunk/examples/info/Program.java
deleted file mode 100644
index d249238b..00000000
--- a/examples/src/main/java/com/splunk/examples/info/Program.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.info;
-
-import com.splunk.*;
-
-public class Program {
- public static void main(String[] args) {
- Command command = Command.splunk("info").parse(args);
- Service service = Service.connect(command.opts);
-
- ServiceInfo info = service.getInfo();
- System.out.println("Info:");
- for (String key : info.keySet())
- System.out.println(" " + key + ": " + info.get(key));
-
- Entity settings = service.getSettings();
- System.out.println("\nSettings:");
- for (String key : settings.keySet())
- System.out.println(" " + key + ": " + settings.get(key));
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/input/Program.java b/examples/src/main/java/com/splunk/examples/input/Program.java
deleted file mode 100644
index 9b6d2c66..00000000
--- a/examples/src/main/java/com/splunk/examples/input/Program.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.input;
-
-import com.splunk.*;
-
-/**
- * Generate events into an index using either stream, submit or raw tcp
- * methods.
- */
-
-public class Program {
-
- public static void main(String[] args) {
- try {
- run(args);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- static void DisplaySpecificInput(Input input) {
- InputKind inputKind = input.getKind();
-
- System.out.println(" **type specific settings");
-
- if (inputKind == InputKind.Monitor) {
- MonitorInput monitorInput = (MonitorInput) input;
- System.out.println(
- " file count: " + monitorInput.getFileCount());
- System.out.println(
- " host: " + monitorInput.getHost());
- System.out.println(
- " index: " + monitorInput.getIndex());
- System.out.println(
- " receive buffer: " + monitorInput.getRcvBuf());
- } else if (inputKind == InputKind.Script) {
- ScriptInput scriptInput = (ScriptInput) input;
- System.out.println(
- " group: " + scriptInput.getGroup());
- System.out.println(
- " host: " + scriptInput.getHost());
- System.out.println(
- " index: " + scriptInput.getIndex());
- System.out.println(
- " interval: " + scriptInput.getInterval());
- System.out.println(
- " receive buffer: " + scriptInput.getRcvBuf());
- } else if (inputKind == InputKind.Tcp) {
- TcpInput tcpInput = (TcpInput) input;
- System.out.println(
- " connection host: " + tcpInput.getConnectionHost());
- System.out.println(
- " group: " + tcpInput.getGroup());
- System.out.println(
- " host: " + tcpInput.getHost());
- System.out.println(
- " index: " + tcpInput.getIndex());
- System.out.println(
- " queue: " + tcpInput.getQueue());
- System.out.println(
- " receive buffer: " + tcpInput.getRcvBuf());
- System.out.println(
- " restrict to host:" + tcpInput.getRestrictToHost());
- System.out.println(
- " source: " + tcpInput.getSource());
- System.out.println(
- " source type: " + tcpInput.getSourceType());
- System.out.println(
- " SSL: " + tcpInput.getSSL());
- } else if (inputKind == InputKind.TcpSplunk) {
- TcpSplunkInput tcpSplunkInput = (TcpSplunkInput) input;
- System.out.println(
- " connection host: " + tcpSplunkInput.getConnectionHost());
- System.out.println(
- " group: " + tcpSplunkInput.getGroup());
- System.out.println(
- " host: " + tcpSplunkInput.getHost());
- System.out.println(
- " index: " + tcpSplunkInput.getIndex());
- System.out.println(
- " queue: " + tcpSplunkInput.getQueue());
- System.out.println(
- " receive buffer: " + tcpSplunkInput.getRcvBuf());
- System.out.println(
- " source: " + tcpSplunkInput.getSource());
- System.out.println(
- " source type: " + tcpSplunkInput.getSourceType());
- System.out.println(
- " SSL: " + tcpSplunkInput.getSSL());
- } else if (inputKind == InputKind.Udp) {
- UdpInput udpInput = (UdpInput) input;
- System.out.println(
- " connection host: " + udpInput.getConnectionHost());
- System.out.println(
- " group: " + udpInput.getGroup());
- System.out.println(
- " host: " + udpInput.getHost());
- System.out.println(
- " index: " + udpInput.getIndex());
- System.out.println(
- " queue: " + udpInput.getQueue());
- System.out.println(
- " receive buffer: " + udpInput.getRcvBuf());
- System.out.println(
- " source: " + udpInput.getSource());
- System.out.println(
- " source type: " + udpInput.getSourceType());
- System.out.println(
- " no timestamp append:" +
- udpInput.getNoAppendingTimeStamp());
- System.out.println(
- " no priority stripping:" +
- udpInput.getNoPriorityStripping());
- } else if (inputKind == InputKind.WindowsActiveDirectory) {
- WindowsActiveDirectoryInput windowsActiveDirectoryInput =
- (WindowsActiveDirectoryInput) input;
- System.out.println(
- " index: " +
- windowsActiveDirectoryInput.getIndex());
- System.out.println(
- " monitor subtree: " +
- windowsActiveDirectoryInput.getMonitorSubtree());
- System.out.println(
- " starting node: " +
- windowsActiveDirectoryInput.getStartingNode());
- System.out.println(
- " target DC: " +
- windowsActiveDirectoryInput.getTargetDc());
- } else if (inputKind == InputKind.WindowsEventLog) {
- WindowsEventLogInput windowsEventLogInput =
- (WindowsEventLogInput) input;
- System.out.println(
- " hosts: " +
- windowsEventLogInput.getHosts());
- System.out.println(
- " index: " +
- windowsEventLogInput.getIndex());
- System.out.println(
- " local name: " +
- windowsEventLogInput.getLocalName());
- String[] logs = windowsEventLogInput.getLogs();
- System.out.println(" logs:");
- if (logs != null)
- for (String log: logs) {
- System.out.println(" " + log);
- }
- System.out.println(
- " lookup host: " +
- windowsEventLogInput.getLookupHost());
- } else if (inputKind == InputKind.WindowsPerfmon) {
- WindowsPerfmonInput windowsPerfmonInput =
- (WindowsPerfmonInput) input;
- System.out.println(
- " counters: " +
- windowsPerfmonInput.getCounters());
- System.out.println(
- " index: " +
- windowsPerfmonInput.getIndex());
- System.out.println(
- " instances: " +
- windowsPerfmonInput.getInstances());
- System.out.println(
- " interval: " +
- windowsPerfmonInput.getInterval());
- System.out.println(
- " object: " +
- windowsPerfmonInput.getObject());
- } else if (inputKind == InputKind.WindowsRegistry) {
- WindowsRegistryInput windowsRegistryInput =
- (WindowsRegistryInput) input;
- System.out.println(
- " baseline: " +
- windowsRegistryInput.getBaseline());
- System.out.println(
- " hive: " +
- windowsRegistryInput.getHive());
- System.out.println(
- " index: " +
- windowsRegistryInput.getIndex());
- System.out.println(
- " monitor subnodes:" +
- windowsRegistryInput.getMonitorSubnodes());
- System.out.println(
- " process: " +
- windowsRegistryInput.getProc());
- System.out.println(
- " type: " +
- windowsRegistryInput.getType());
- } else if (inputKind == InputKind.WindowsWmi) {
- WindowsWmiInput windowsWmiInput = (WindowsWmiInput) input;
- System.out.println(
- " WMI input: " +
- windowsWmiInput.getClasses());
- String[] fields = windowsWmiInput.getFields();
- System.out.println(" fields:");
- for (String field: fields) {
- System.out.println(" " + field);
- }
- System.out.println(
- " index: " +
- windowsWmiInput.getIndex());
-
- String[] instances = windowsWmiInput.getInstances();
- System.out.println(" instances:");
- for (String instance: instances) {
- System.out.println(" " + instance);
- }
- System.out.println(
- " interval: " +
- windowsWmiInput.getInterval());
- System.out.println(
- " local name: " +
- windowsWmiInput.getLocalName());
- System.out.println(
- " lookup host: " +
- windowsWmiInput.getLookupHost());
- System.out.println(
- " server: " +
- windowsWmiInput.getServers());
- System.out.println(
- " WQL: " + windowsWmiInput.getWql());
- }
- }
-
- static void run(String[] argsIn) throws Exception {
-
- Command command;
- Service service;
-
- command = Command.splunk("input");
- service = Service.connect(command.opts);
-
- InputCollection inputs = service.getInputs();
-
- // Iterate inputs and make sure we can read them.
- for (Input input : inputs.values()) {
- System.out.println("Input name: " + input.getName());
- System.out.println(" title: " + input.getTitle());
- System.out.println(" path: " + input.getPath());
- System.out.println(" type: " + input.getKind());
- DisplaySpecificInput(input);
- System.out.println("\n\n");
- }
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/pivot/Program.java b/examples/src/main/java/com/splunk/examples/pivot/Program.java
deleted file mode 100644
index bcb55dec..00000000
--- a/examples/src/main/java/com/splunk/examples/pivot/Program.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package com.splunk.examples.pivot;
-
-import com.splunk.*;
-
-public class Program {
- public static void main(String[] argv) {
- try {
- run(argv);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- static void run(String[] argsIn) throws Exception {
- Command command;
- Service service;
-
- command = Command.splunk("input");
- service = Service.connect(command.opts);
-
- DataModel dataModel = service.getDataModels().get("internal_audit_logs");
- DataModelObject searches = dataModel.getObject("searches");
-
- System.out.print("Working with object " + searches.getDisplayName());
- System.out.println(" in model " + dataModel.getDisplayName());
- System.out.print(" Lineage: ");
- for (String name : searches.getLineage()) {
- System.out.print(" -> " + name);
- }
- System.out.println();
- System.out.println(" Internal name: " + searches.getName());
-
- Job firstFiveEntries = searches.runQuery("| head 5");
- while (!firstFiveEntries.isDone()) {
- Thread.sleep(100);
- }
-
- ResultsReaderXml results = new ResultsReaderXml(firstFiveEntries.getResults());
- for (Event event : results) {
- System.out.println(event.toString());
- }
-
- System.out.println("~~~~~~~~~~~~~~~~~~~~");
- System.out.println("Pivoting on searches");
-
- PivotSpecification pivotSpecification = searches.createPivotSpecification();
-
- pivotSpecification.addRowSplit("user", "Executing user");
- pivotSpecification.addColumnSplit("exec_time", null, null, null, 4);
- pivotSpecification.addCellValue("search", "Search Query", StatsFunction.DISTINCT_VALUES);
-
- Pivot pivot = pivotSpecification.pivot();
- System.out.println("Query for binning search queries by execution time and executing user:");
- System.out.println(" " + pivot.getPrettyQuery());
-
- Job pivotJob = pivot.run();
- while (!pivotJob.isDone()) {
- Thread.sleep(100);
- }
-
- results = new ResultsReaderXml(pivotJob.getResults());
- for (Event event : results) {
- System.out.println(event.toString());
- }
-
- }
-}
-
-
diff --git a/examples/src/main/java/com/splunk/examples/random_numbers/Program.java b/examples/src/main/java/com/splunk/examples/random_numbers/Program.java
deleted file mode 100644
index f21e02c0..00000000
--- a/examples/src/main/java/com/splunk/examples/random_numbers/Program.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright 2013 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.random_numbers;
-
-import com.splunk.modularinput.*;
-
-import javax.xml.stream.XMLStreamException;
-import java.io.IOException;
-import java.util.Random;
-
-// All modular inputs should inherit from the abstract base class com.splunk.modularinput.Script. They must override
-// the getScheme and streamEvents methods, and, if the scheme returned by getScheme had
-// Scheme.setUseExternalValidation(true) called on it, the validateInput method. The user must provide a main
-// method since static methods can't be inherited in Java. However, the main is very simple.
-public class Program extends Script {
-
- // All main methods for modular inputs need only be one line. They can't be inherited because they must create
- // an instance of this class, and the abstract base class has no way to do so. So if the class were called MyInput,
- // the one line would be
- //
- // new MyInput().run(args);
- //
- public static void main(String[] args) {
- new Program().run(args);
- }
-
- // When Splunk starts, it looks for all the modular inputs defined by its configuration, and tries to run them
- // with the argument --scheme. Splunkd expects the modular inputs to print a description of the input in XML
- // on stdout. The modular input framework takes care of all the details of formatting XML and printing it. The
- // user need only override getScheme and return a new Scheme object.
- @Override
- public Scheme getScheme() {
- // "random_numbers" is the name Splunk will display to users for this input.
- Scheme scheme = new Scheme("random_numbers");
-
- scheme.setDescription("Generates events containing a random number.");
- // If you set external validation, without overriding validateInput, the script will accept anything as valid.
- // Generally you only need external validation if there are relationships you must maintain among the
- // parameters, such as requiring min to be less than max in this example, or you need to check that some
- // resource is reachable or valid. Otherwise, Splunk lets you specify a validation string for each argument
- // and will run validation internally using that string.
- scheme.setUseExternalValidation(true);
- scheme.setUseSingleInstance(true);
-
- Argument minArgument = new Argument("min");
- minArgument.setDataType(Argument.DataType.NUMBER);
- minArgument.setDescription("Minimum value to be produced by this input.");
- minArgument.setRequiredOnCreate(true);
- // If you are not using external validation, you would add something like:
- //
- // setValidation("min > 0");
- scheme.addArgument(minArgument);
-
- Argument maxArgument = new Argument("max");
- maxArgument.setDataType(Argument.DataType.NUMBER);
- maxArgument.setDescription("Maximum value to be produced by this input.");
- maxArgument.setRequiredOnCreate(true);
- scheme.addArgument(maxArgument);
-
- return scheme; // ...and don't forget to return the scheme.
- }
-
- // In this example we are using external validation, since we want max to always be greater than min.
- // If validateInput does not throw an Exception, the input is assumed to be valid. Otherwise it prints the
- // exception as an error message when telling splunkd that the configuration is not valid.
- //
- // When using external validation, after splunkd calls the modular input with --scheme to get a scheme, it calls it
- // again with --validate-arguments for each instance of the modular input in its configuration files, feeding XML
- // on stdin to the modular input to get it to do validation. It calls it the same way again whenever a modular
- // input's configuration is changed.
- @Override
- public void validateInput(ValidationDefinition definition) throws Exception {
- // Get the values of the two parameters. There are also methods getFloat, getInt, getBoolean, etc.,
- // and getValue to get the string representation.
- double min = ((SingleValueParameter)definition.getParameters().get("min")).getDouble();
- double max = ((SingleValueParameter)definition.getParameters().get("max")).getDouble();
-
- if (min >= max) {
- throw new Exception("min must be less than max; found min=" + Double.toString(min) +
- ", max=" + Double.toString(max));
- }
- }
-
- // Finally, the real action: splunk calls the modular input with no arguments, streams a bunch of XML describing
- // the inputs to stdin, and waits for XML on stdout describing events.
- //
- // If you set setUseSingleInstance(true) on the scheme in getScheme, it will pass all the instances of this input
- // to a single instance of this script and it's your job to handle them all. Otherwise, it starts a JVM for each
- // instance of the input.
- //
- // We are using a single instance, and starting a thread for each instance of the modular input. For scripts that
- // are not single instance, it is simpler to do the work directly in the streamEvents method.
- @Override
- public void streamEvents(InputDefinition inputs, EventWriter ew) throws MalformedDataException,
- XMLStreamException, IOException {
- for (String inputName : inputs.getInputs().keySet()) {
- // We get the parameters for each input and start a new thread for each one. All the real work
- // happens in the Generator class below.
- double min = ((SingleValueParameter)inputs.getInputs().get(inputName).get("min")).getDouble();
- double max = ((SingleValueParameter)inputs.getInputs().get(inputName).get("max")).getDouble();
-
- Thread t = new Thread(new Generator(ew, inputName, min, max));
- t.run();
- }
- }
-
- // A Runnable that generates events with a random number in the proper range every half second. All the important
- // stuff to look at is in the run method.
- class Generator implements Runnable {
- private double min, max;
- EventWriter ew;
- String inputName;
-
- public Generator(EventWriter ew, String inputName, double min, double max) {
- super();
- this.min = min;
- this.max = max;
- this.ew = ew;
- this.inputName = inputName;
- }
-
- public void run() {
- // First we log an INFO message that this thread has started. This will show up in splunkd.log and in
- // Splunk's _internal index.
-
- // EventWriter provides both log and synchronizedLog (one a synchronized version of the other). In
- // this case, synchronizing at the level of each log message and event is exactly what we want. In
- // more complicated cases, you may want to use the unsynchronized version and do your own
- // synchronization.
- ew.synchronizedLog(EventWriter.INFO, "Random number generator " + inputName +
- " started, generating numbers between " +
- Double.toString(min) + " and " + Double.toString(max));
-
- final Random randomGenerator = new Random();
-
- while (true) {
- // Write a new event. The minimum that you must set on an event is the stanza it is supposed to
- // go to (which you can skip if your modular input is not single instance, and the data of the
- // event.
- Event event = new Event();
- event.setStanza(inputName);
- event.setData("number=" + (randomGenerator.nextDouble() * (max - min) + min));
-
- try {
- ew.writeEvent(event);
- } catch (MalformedDataException e) {
- ew.synchronizedLog(EventWriter.ERROR, "MalformedDataException in writing event to input" +
- inputName + ": " + e.toString());
- }
-
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- return;
- }
- }
- }
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/random_numbers/random_numbers/README/inputs.conf.spec b/examples/src/main/java/com/splunk/examples/random_numbers/random_numbers/README/inputs.conf.spec
deleted file mode 100644
index 2b507cea..00000000
--- a/examples/src/main/java/com/splunk/examples/random_numbers/random_numbers/README/inputs.conf.spec
+++ /dev/null
@@ -1,5 +0,0 @@
-[random_numbers://default]
-*Generates events containing a random floating point number.
-
-min =
-max =
diff --git a/examples/src/main/java/com/splunk/examples/random_numbers/random_numbers/default/app.conf b/examples/src/main/java/com/splunk/examples/random_numbers/random_numbers/default/app.conf
deleted file mode 100644
index 057bd137..00000000
--- a/examples/src/main/java/com/splunk/examples/random_numbers/random_numbers/default/app.conf
+++ /dev/null
@@ -1,12 +0,0 @@
-[install]
-is_configured = 0
-
-[ui]
-is_visible = 1
-label = random-numbers
-
-[launcher]
-author = Fred Ross
-description =
-version = 1.0
-
diff --git a/examples/src/main/java/com/splunk/examples/search/Program.java b/examples/src/main/java/com/splunk/examples/search/Program.java
deleted file mode 100644
index f2fbd25a..00000000
--- a/examples/src/main/java/com/splunk/examples/search/Program.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.search;
-
-import com.splunk.*;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.util.Arrays;
-import java.util.HashMap;
-
-// Note: not all search parameters are exposed to the CLI for this example.
-public class Program {
- static String[] outputChoices = new String[] {
- "events", "results", "preview", "searchlog", "summary", "timeline"
- };
-
- static String earliestTimeText = "Search earliest time";
- static String fieldListText =
- "A comma-separated list of the fields to return";
- static String latestTimeText = "Search latest time";
- static String offset =
- "The first result (inclusive) from which to begin returning data. " +
- "(default: 0)";
- static String outputText =
- "Which search results to output {events, results, preview, searchlog," +
- " summary, timeline} (default: results)";
- static String outputModeText =
- "Search output format {csv, raw, json, xml} (default: xml)";
- static String resultsCount =
- "The maximum number of results to return (default: 100)";
- static String readerText = "Use ResultsReader";
- static String statusBucketsText =
- "Number of status buckets to use for search (default: 0)";
- static String verboseString = "Display search progress";
-
- public static void main(String[] args) {
- try {
- run(args);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- static void run(String[] args) throws Exception {
- Command command = Command.splunk("search");
- command.addRule("count", Integer.class, resultsCount);
- command.addRule("earliest_time", String.class, earliestTimeText);
- command.addRule("field_list", String.class, fieldListText);
- command.addRule("latest_time", String.class, latestTimeText);
- command.addRule("offset", Integer.class, offset);
- command.addRule("output", String.class, outputText);
- command.addRule("output_mode", String.class, outputModeText);
- command.addRule("reader", readerText);
- command.addRule("status_buckets", Integer.class, statusBucketsText);
- command.addRule("verbose", verboseString);
- command.parse(args);
-
- if (command.args.length != 1)
- Command.error("Search expression required");
- String query = command.args[0];
-
- int resultsCount = 100;
- if (command.opts.containsKey("count"))
- resultsCount = (Integer)command.opts.get("count");
-
- String earliestTime = null;
- if (command.opts.containsKey("earliest_time"))
- earliestTime = (String)command.opts.get("earliest_time");
-
- String fieldList = null;
- if (command.opts.containsKey("field_list"))
- fieldList = (String)command.opts.get("field_list");
-
- String latestTime = null;
- if (command.opts.containsKey("latest_time"))
- latestTime = (String)command.opts.get("latest_time");
-
- int offset = 0;
- if (command.opts.containsKey("offset"))
- offset = (Integer)command.opts.get("offset");
-
- String output = "results";
- if (command.opts.containsKey("output")) {
- output = (String)command.opts.get("output");
- if (!Arrays.asList(outputChoices).contains(output))
- Command.error("Unsupported output: '%s'", output);
- }
-
- String outputMode = "xml";
- if (command.opts.containsKey("output_mode"))
- outputMode = (String)command.opts.get("output_mode");
-
- int statusBuckets = 0;
- if (command.opts.containsKey("status_buckets"))
- statusBuckets = (Integer)command.opts.get("status_buckets");
-
- boolean verbose = command.opts.containsKey("verbose");
-
- Service service = Service.connect(command.opts);
-
- // Check the syntax of the query.
- try {
- service.parse(query, new Args("parse_only", true));
- }
- catch (HttpException e) {
- Command.error("query '%s' is invalid: %s", query, e.getDetail());
- }
-
- // Create a search job for the given query & query arguments.
- Args queryArgs = new Args();
- if (earliestTime != null)
- queryArgs.put("earliest_time", earliestTime);
- if (fieldList != null)
- queryArgs.put("field_list", fieldList);
- if (latestTime != null)
- queryArgs.put("latest_time", latestTime);
- if (statusBuckets > 0)
- queryArgs.put("status_buckets", statusBuckets);
-
- Job job = service.getJobs().create(query, queryArgs);
-
- // Wait until results are available.
- boolean didPrintAStatusLine = false;
- while (!job.isDone()) {
- // If no outputs are available, optionally print status
- if (verbose && job.isReady()) {
- float progress = job.getDoneProgress() * 100.0f;
- int scanned = job.getScanCount();
- int matched = job.getEventCount();
- int results = job.getResultCount();
- System.out.format(
- "\r%03.1f%% done -- %d scanned -- %d matched -- %d results",
- progress, scanned, matched, results);
- didPrintAStatusLine = true;
- }
-
- Thread.sleep(1000);
- }
- if (didPrintAStatusLine)
- System.out.println("");
-
- Args outputArgs = new Args();
- outputArgs.put("count", resultsCount);
- outputArgs.put("offset", offset);
- outputArgs.put("output_mode", outputMode);
-
- InputStream stream;
- if (output.equals("results"))
- stream = job.getResults(outputArgs);
- else if (output.equals("events"))
- stream = job.getEvents(outputArgs);
- else if (output.equals("preview"))
- stream = job.getResultsPreview(outputArgs);
- else if (output.equals("searchlog"))
- stream = job.getSearchLog(outputArgs);
- else if (output.equals("summary"))
- stream = job.getSummary(outputArgs);
- else if (output.equals("timeline"))
- stream = job.getTimeline(outputArgs);
- else
- throw new IllegalArgumentException(
- "Unrecognized output type: " + output);
-
- boolean useReader = command.opts.containsKey("reader");
- if (useReader) {
- ResultsReader resultsReader;
- if (outputMode.equals("xml"))
- resultsReader = new ResultsReaderXml(stream);
- else if (outputMode.equals("json"))
- resultsReader = new ResultsReaderJson(stream);
- else if (outputMode.equals("csv"))
- resultsReader = new ResultsReaderCsv(stream);
- else
- throw new IllegalArgumentException(
- "Unrecognized output mode: " + outputMode);
-
- try {
- HashMap event;
- while ((event = resultsReader.getNextEvent()) != null) {
- System.out.println("EVENT:********");
- for (String key : event.keySet())
- System.out.println(" " + key + " --> " + event.get(key));
- }
- }
- finally {
- resultsReader.close();
- }
- }
- else {
- InputStreamReader reader = new InputStreamReader(stream, "UTF-8");
- try {
- OutputStreamWriter writer = new OutputStreamWriter(System.out);
- try {
- int size = 1024;
- char[] buffer = new char[size];
- while (true) {
- int count = reader.read(buffer);
- if (count == -1) break;
- writer.write(buffer, 0, count);
- }
-
- writer.write("\n");
- }
- finally {
- writer.close();
- }
- }
- finally {
- reader.close();
- }
- }
-
- job.cancel();
- }
-}
\ No newline at end of file
diff --git a/examples/src/main/java/com/splunk/examples/search_blocking/Program.java b/examples/src/main/java/com/splunk/examples/search_blocking/Program.java
deleted file mode 100644
index b01e946f..00000000
--- a/examples/src/main/java/com/splunk/examples/search_blocking/Program.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.search_blocking;
-
-import com.splunk.*;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.util.Arrays;
-import java.util.HashMap;
-
-// Note: not all search parameters are exposed to the CLI for this example.
-public class Program {
- static String[] outputChoices = new String[] {
- "events", "results", "preview", "searchlog", "summary", "timeline"
- };
-
- static String earliestTimeText = "Search earliest time";
- static String fieldListText =
- "A comma-separated list of the fields to return";
- static String latestTimeText = "Search latest time";
- static String offset =
- "The first result (inclusive) from which to begin returning data. " +
- "(default: 0)";
- static String outputText =
- "Which search results to output {events, results, preview, searchlog," +
- " summary, timeline} (default: results)";
- static String outputModeText =
- "Search output format {csv, raw, json, xml} (default: xml)";
- static String resultsCount =
- "The maximum number of results to return (default: 100)";
- static String rawText = "Set to 1 if raw events are displayed (default 1)";
- static String statusBucketsText =
- "Number of status buckets to use for search (default: 0)";
-
- public static void main(String[] args) {
- try {
- run(args);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- static void run(String[] args) throws IOException {
- Command command = Command.splunk("search");
- command.addRule("count", Integer.class, resultsCount);
- command.addRule("earliest_time", String.class, earliestTimeText);
- command.addRule("field_list", String.class, fieldListText);
- command.addRule("latest_time", String.class, latestTimeText);
- command.addRule("offset", Integer.class, offset);
- command.addRule("output", String.class, outputText);
- command.addRule("output_mode", String.class, outputModeText);
- command.addRule("raw", Integer.class, rawText);
- command.addRule("status_buckets", Integer.class, statusBucketsText);
- command.parse(args);
-
- if (command.args.length != 1)
- Command.error("Search expression required");
- String query = command.args[0];
-
- int resultsCount = 100;
- if (command.opts.containsKey("count"))
- resultsCount = (Integer)command.opts.get("count");
-
- String earliestTime = null;
- if (command.opts.containsKey("earliest_time"))
- earliestTime = (String)command.opts.get("earliest_time");
-
- String fieldList = null;
- if (command.opts.containsKey("field_list"))
- fieldList = (String)command.opts.get("field_list");
-
- String latestTime = null;
- if (command.opts.containsKey("latest_time"))
- latestTime = (String)command.opts.get("latest_time");
-
- int offset = 0;
- if (command.opts.containsKey("offset"))
- offset = (Integer)command.opts.get("offset");
-
- String output = "results";
- if (command.opts.containsKey("output")) {
- output = (String)command.opts.get("output");
- if (!Arrays.asList(outputChoices).contains(output))
- Command.error("Unsupported output: '%s'", output);
- }
-
- String outputMode = "xml";
- if (command.opts.containsKey("output_mode"))
- outputMode = (String)command.opts.get("output_mode");
-
- int statusBuckets = 0;
- if (command.opts.containsKey("status_buckets"))
- statusBuckets = (Integer)command.opts.get("status_buckets");
-
- Service service = Service.connect(command.opts);
-
- // Check the syntax of the query.
- try {
- Args parseArgs = new Args("parse_only", true);
- service.parse(query, parseArgs);
- }
- catch (HttpException e) {
- String detail = e.getDetail();
- Command.error("query '%s' is invalid: %s", query, detail);
- }
-
- // Create a search job for the given query & query arguments.
- Args queryArgs = new Args();
- if (earliestTime != null)
- queryArgs.put("earliest_time", earliestTime);
- if (fieldList != null)
- queryArgs.put("field_list", fieldList);
- if (latestTime != null)
- queryArgs.put("latest_time", latestTime);
- if (statusBuckets > 0)
- queryArgs.put("status_buckets", statusBuckets);
-
- // Always block until results are ready.
- queryArgs.put("exec_mode", "blocking");
- Job job = service.getJobs().create(query, queryArgs);
-
- InputStream stream = null;
-
- Args outputArgs = new Args();
- outputArgs.put("count", resultsCount);
- outputArgs.put("offset", offset);
- outputArgs.put("output_mode", outputMode);
-
- if (output.equals("results"))
- stream = job.getResults(outputArgs);
- else if (output.equals("events"))
- stream = job.getEvents(outputArgs);
- else if (output.equals("preview"))
- stream = job.getResultsPreview(outputArgs);
- else if (output.equals("searchlog"))
- stream = job.getSearchLog(outputArgs);
- else if (output.equals("summary"))
- stream = job.getSummary(outputArgs);
- else if (output.equals("timeline"))
- stream = job.getTimeline(outputArgs);
- else assert(false);
-
- boolean rawData = true;
- if (command.opts.containsKey("raw")) {
- int tmp = (Integer)command.opts.get("raw");
- if (tmp == 0 ) rawData = false;
- }
-
- if (!rawData) {
- HashMap map;
- try {
- ResultsReaderXml resultsReader = new ResultsReaderXml(stream);
- while ((map = resultsReader.getNextEvent()) != null) {
- System.out.println("EVENT:********");
- System.out.println(" " + map);
- }
- resultsReader.close();
- } catch (IOException e) {
- System.out.println("I/O exception: " + e);
- }
- }
- else {
- InputStreamReader reader = new InputStreamReader(stream, "UTF-8");
- OutputStreamWriter writer = new OutputStreamWriter(System.out);
-
- int size = 1024;
- char[] buffer = new char[size];
- while (true) {
- int count = reader.read(buffer);
- if (count == -1) break;
- writer.write(buffer, 0, count);
- }
-
- writer.write("\n");
- writer.close();
- reader.close();
- }
- job.cancel();
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/search_oneshot/Program.java b/examples/src/main/java/com/splunk/examples/search_oneshot/Program.java
deleted file mode 100644
index 1042ba07..00000000
--- a/examples/src/main/java/com/splunk/examples/search_oneshot/Program.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.search_oneshot;
-
-import com.splunk.Args;
-import com.splunk.HttpException;
-import com.splunk.ResultsReaderXml;
-import com.splunk.Service;
-import com.splunk.Command;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.util.HashMap;
-
-// Note: not all search parameters are exposed to the CLI for this example.
-public class Program {
-
- static String earliestTimeText = "Search earliest time";
- static String fieldListText =
- "A comma-separated list of the fields to return";
- static String latestTimeText = "Search latest time";
- static String outputModeText =
- "Search output format {csv, raw, json, xml} (default: xml)";
- static String rawText = "Set to 1 if raw events are displayed";
- static String statusBucketsText =
- "Number of status buckets to use for search (default: 0)";
-
- public static void main(String[] args) {
- try {
- run(args);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- static void run(String[] args) throws IOException {
- Command command = Command.splunk("search");
- command.addRule("earliest_time", String.class, earliestTimeText);
- command.addRule("field_list", String.class, fieldListText);
- command.addRule("latest_time", String.class, latestTimeText);
- command.addRule("output_mode", String.class, outputModeText);
- command.addRule("raw", Integer.class, rawText);
- command.addRule("status_buckets", Integer.class, statusBucketsText);
- command.parse(args);
-
- if (command.args.length != 1)
- Command.error("Search expression required");
- String query = command.args[0];
-
- String earliestTime = null;
- if (command.opts.containsKey("earliest_time"))
- earliestTime = (String)command.opts.get("earliest_time");
-
- String fieldList = null;
- if (command.opts.containsKey("field_list"))
- fieldList = (String)command.opts.get("field_list");
-
- String latestTime = null;
- if (command.opts.containsKey("latest_time"))
- latestTime = (String)command.opts.get("latest_time");
-
- int statusBuckets = 0;
- if (command.opts.containsKey("status_buckets"))
- statusBuckets = (Integer)command.opts.get("status_buckets");
-
- String outputMode = "xml";
- if (command.opts.containsKey("output_mode"))
- outputMode = (String)command.opts.get("output_mode");
-
- Service service = Service.connect(command.opts);
-
- // Check the syntax of the query.
- try {
- Args parseArgs = new Args("parse_only", true);
- service.parse(query, parseArgs);
- }
- catch (HttpException e) {
- String detail = e.getDetail();
- Command.error("query '%s' is invalid: %s", query, detail);
- }
-
- // Create the oneshot search query & query arguments.
- Args queryArgs = new Args();
- if (earliestTime != null)
- queryArgs.put("earliest_time", earliestTime);
- if (fieldList != null)
- queryArgs.put("field_list", fieldList);
- if (latestTime != null)
- queryArgs.put("latest_time", latestTime);
- if (statusBuckets > 0)
- queryArgs.put("status_buckets", statusBuckets);
- queryArgs.put("output_mode", outputMode);
-
- // Execute the oneshot query, which returns the stream (i.e. there is
- // no search job created, just a one time search)
- InputStream stream = service.oneshotSearch(query, queryArgs);
-
- boolean rawData = true;
- if (command.opts.containsKey("raw")) {
- int tmp = (Integer)command.opts.get("raw");
- if (tmp == 0 ) rawData = false;
- }
-
- if (!rawData) {
- HashMap map;
- try {
- ResultsReaderXml resultsReader = new ResultsReaderXml(stream);
- while ((map = resultsReader.getNextEvent()) != null) {
- System.out.println("EVENT:********");
- System.out.println(" " + map);
- }
- resultsReader.close();
- } catch (IOException e) {
- System.out.println("I/O exception: " + e);
- }
- }
- else {
- InputStreamReader reader = new InputStreamReader(stream, "UTF-8");
- OutputStreamWriter writer = new OutputStreamWriter(System.out);
-
- int size = 1024;
- char[] buffer = new char[size];
- while (true) {
- int count = reader.read(buffer);
- if (count == -1) break;
- writer.write(buffer, 0, count);
- }
-
- writer.write("\n");
- writer.close();
- reader.close();
- }
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/search_realtime/Program.java b/examples/src/main/java/com/splunk/examples/search_realtime/Program.java
deleted file mode 100644
index f2372b53..00000000
--- a/examples/src/main/java/com/splunk/examples/search_realtime/Program.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.search_realtime;
-
-import com.splunk.*;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.util.Arrays;
-import java.util.HashMap;
-
-// Note: not all search parameters are exposed to the CLI for this example.
-public class Program {
- static String[] outputChoices = new String[] {
- "events", "results", "preview", "searchlog", "summary", "timeline"
- };
-
- static String earliestTimeText =
- "Search earliest time (default: 'rt-5m')";
- static String fieldListText =
- "A comma-separated list of the fields to return";
- static String latestTimeText =
- "Search latest time (default: 'rt' (i.e. now))";
- static String offset =
- "The first result (inclusive) from which to begin returning data. " +
- "(default: 0)";
- static String outputText =
- "Which search results to output {events, results, preview, searchlog," +
- " summary, timeline} (default: preview)";
- static String outputModeText =
- "Search output format {csv, raw, json, xml} (default: xml)";
- static String rawText = "Set to 1 if raw events are displayed";
- static String resultsCount =
- "The maximum number of results to return (default: 100)";
- static String statusBucketsText =
- "Number of status buckets to use for search (default: 0)";
-
- public static void main(String[] args) {
- try {
- run(args);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- static void run(String[] args) throws IOException {
- Command command = Command.splunk("search");
- command.addRule("count", Integer.class, resultsCount);
- command.addRule("earliest_time", String.class, earliestTimeText);
- command.addRule("field_list", String.class, fieldListText);
- command.addRule("latest_time", String.class, latestTimeText);
- command.addRule("offset", Integer.class, offset);
- command.addRule("output", String.class, outputText);
- command.addRule("output_mode", String.class, outputModeText);
- command.addRule("raw", Integer.class, rawText);
- command.addRule("status_buckets", Integer.class, statusBucketsText);
- command.parse(args);
-
- if (command.args.length != 1)
- Command.error("Search expression required");
- String query = command.args[0];
-
- int resultsCount = 100;
- if (command.opts.containsKey("count"))
- resultsCount = (Integer)command.opts.get("count");
-
- String earliestTime = "rt-5m";
- if (command.opts.containsKey("earliest_time"))
- earliestTime = (String)command.opts.get("earliest_time");
-
- String fieldList = null;
- if (command.opts.containsKey("field_list"))
- fieldList = (String)command.opts.get("field_list");
-
- String latestTime = "rt";
- if (command.opts.containsKey("latest_time"))
- latestTime = (String)command.opts.get("latest_time");
-
- int offset = 0;
- if (command.opts.containsKey("offset"))
- offset = (Integer)command.opts.get("offset");
-
- String output = "preview";
- if (command.opts.containsKey("output")) {
- output = (String)command.opts.get("output");
- if (!Arrays.asList(outputChoices).contains(output))
- Command.error("Unsupported output: '%s'", output);
- }
-
- String outputMode = "xml";
- if (command.opts.containsKey("output_mode"))
- outputMode = (String)command.opts.get("output_mode");
-
- int statusBuckets = 0;
- if (command.opts.containsKey("status_buckets"))
- statusBuckets = (Integer)command.opts.get("status_buckets");
-
- Service service = Service.connect(command.opts);
-
- // Check the syntax of the query.
- try {
- Args parseArgs = new Args("parse_only", true);
- service.parse(query, parseArgs);
- }
- catch (HttpException e) {
- String detail = e.getDetail();
- Command.error("query '%s' is invalid: %s", query, detail);
- }
-
- // Create a search job for the given query & query arguments.
- Args queryArgs = new Args();
- if (fieldList != null)
- queryArgs.put("field_list", fieldList);
- if (statusBuckets > 0)
- queryArgs.put("status_buckets", statusBuckets);
-
- // Always set real time search mode
- queryArgs.put("search_mode", "realtime");
- queryArgs.put("earliest_time", earliestTime);
- queryArgs.put("latest_time", latestTime);
-
- Job job = service.getJobs().create(query, queryArgs);
-
- while (!job.isReady()) {
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {
- // You shouldn't ever get here.
- }
- }
-
- InputStream stream = null;
-
- Args outputArgs = new Args();
- outputArgs.put("count", resultsCount);
- outputArgs.put("offset", offset);
- outputArgs.put("output_mode", outputMode);
-
- if (output.equals("results"))
- stream = job.getResults(outputArgs);
- else if (output.equals("events"))
- stream = job.getEvents(outputArgs);
- else if (output.equals("preview"))
- stream = job.getResultsPreview(outputArgs);
- else if (output.equals("searchlog"))
- stream = job.getSearchLog(outputArgs);
- else if (output.equals("summary"))
- stream = job.getSummary(outputArgs);
- else if (output.equals("timeline"))
- stream = job.getTimeline(outputArgs);
- else assert(false);
-
- boolean rawData = false;
- if (command.opts.containsKey("raw")) {
- int tmp = (Integer)command.opts.get("raw");
- if (tmp == 0 ) rawData = false;
- }
-
- if (!rawData) {
- HashMap map;
- try {
- ResultsReaderXml resultsReader = new ResultsReaderXml(stream);
- while ((map = resultsReader.getNextEvent()) != null) {
- System.out.println("EVENT:********");
- System.out.println(" " + map);
- }
- resultsReader.close();
- } catch (IOException e) {
- System.out.println("I/O exception: " + e);
- }
- }
- else {
- InputStreamReader reader = new InputStreamReader(stream, "UTF-8");
- OutputStreamWriter writer = new OutputStreamWriter(System.out);
-
- int size = 1024;
- char[] buffer = new char[size];
- while (true) {
- int count = reader.read(buffer);
- if (count == -1) break;
- writer.write(buffer, 0, count);
- }
-
- writer.write("\n");
- writer.close();
- reader.close();
- }
- job.cancel();
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/search_saved/Program.java b/examples/src/main/java/com/splunk/examples/search_saved/Program.java
deleted file mode 100644
index be48ba02..00000000
--- a/examples/src/main/java/com/splunk/examples/search_saved/Program.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.search_saved;
-
-import com.splunk.*;
-
-public class Program {
-
- static String countString = "How many saved searches to return";
- static String offsetString = "The offset into the collection";
-
- private static void list(Service service, Args window) {
-
- EntityCollection searches;
-
- if (window == null)
- searches = service.getSavedSearches();
- else
- searches = service.getSavedSearches(window);
-
- for (SavedSearch entity: searches.values()) {
- System.out.println(
- entity.getTitle() + "\n" +
- " (" + entity.getSearch()+ ")");
- }
- }
-
- public static void main(String[] args) {
- Command command = Command.splunk("search saved").parse(args);
- command.addRule("count", String.class, countString);
- command.addRule("offset", String.class, offsetString);
- Service service = Service.connect(command.opts);
-
- if (command.args.length == 0) {
- list(service, null);
- return;
- }
-
- Args window = new Args();
- for (String value: args) {
- String [] parts = value.split("=");
- if (parts.length != 2) {
- Command.error("Arguments are of the form: name=value");
- }
- if (!parts[0].equals("count") && !parts[0].equals("offset")) {
- Command.error("Unknown key: " + parts[0]);
- }
- window.put(parts[0], parts[1]);
- }
-
- list(service, window);
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/search_simple/Program.java b/examples/src/main/java/com/splunk/examples/search_simple/Program.java
deleted file mode 100644
index 9f279ddc..00000000
--- a/examples/src/main/java/com/splunk/examples/search_simple/Program.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.search_simple;
-
-import com.splunk.Args;
-import com.splunk.HttpException;
-import com.splunk.Service;
-import com.splunk.Command;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-
-// Note: not all search parameters are exposed to the CLI for this example.
-public class Program {
-
- public static void main(String[] args) {
- try {
- run(args);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- static void run(String[] args) throws IOException {
- Command command = Command.splunk("search");
- command.parse(args);
-
- if (command.args.length != 1)
- Command.error("Search expression required");
- String query = command.args[0];
-
- Service service = Service.connect(command.opts);
-
- // Check the syntax of the query.
- try {
- Args parseArgs = new Args("parse_only", true);
- service.parse(query, parseArgs);
- }
- catch (HttpException e) {
- String detail = e.getDetail();
- Command.error("query '%s' is invalid: %s", query, detail);
- }
-
- // This is the simplest form of searching splunk. Note that additional
- // arguments are allowed, but they are not shown in this example.
- InputStream stream = service.oneshotSearch(query);
-
- InputStreamReader reader = new InputStreamReader(stream, "UTF-8");
- try {
- OutputStreamWriter writer = new OutputStreamWriter(System.out);
- try {
- int size = 1024;
- char[] buffer = new char[size];
- while (true) {
- int count = reader.read(buffer);
- if (count == -1) break;
- writer.write(buffer, 0, count);
- }
-
- writer.write("\n");
- }
- finally {
- writer.close();
- }
- }
- finally {
- reader.close();
- }
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/spurl/Program.java b/examples/src/main/java/com/splunk/examples/spurl/Program.java
deleted file mode 100644
index 8c1707b3..00000000
--- a/examples/src/main/java/com/splunk/examples/spurl/Program.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.spurl;
-
-import com.splunk.Service;
-import com.splunk.ResponseMessage;
-import com.splunk.Command;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.io.IOException;
-
-public class Program {
- public static void main(String[] args) {
- try {
- run(args);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- static void run(String[] args) throws IOException {
- Command command = Command.splunk("test").parse(args);
- Service service = Service.connect(command.opts);
-
- String path = command.args.length > 0 ? command.args[0] : "/";
- ResponseMessage response = service.get(path);
-
- int status = response.getStatus();
- System.out.println(String.format("=> %d", status));
- if (status != 200) return;
-
- BufferedReader reader = new BufferedReader(
- new InputStreamReader(response.getContent(), "UTF-8"));
- while (true) {
- String line = reader.readLine();
- if (line == null) break;
- System.out.println(line);
- }
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/ssl_protocols/Program.java b/examples/src/main/java/com/splunk/examples/ssl_protocols/Program.java
deleted file mode 100644
index a6352054..00000000
--- a/examples/src/main/java/com/splunk/examples/ssl_protocols/Program.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright 2015 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * This example will demonstrate how to use a specific SSL/TLS
- * protocol to connect to Splunk.
- * Additionally, there's a small code sample showing how to
- * use a custom SSLSocketFactory to connect to Splunk.
- */
-
-package com.splunk.examples.ssl_protocols;
-
-import com.splunk.Command;
-import com.splunk.SSLSecurityProtocol;
-import com.splunk.Service;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-import java.security.SecureRandom;
-import java.security.cert.X509Certificate;
-
-
-public class Program {
-
- public static Integer getJavaVersion() {
- String ver = System.getProperty("java.version");
- return Integer.parseInt(ver.substring(2, 3));
- }
-
- public static void main(String[] args) {
- Command command = Command.splunk("info").parse(args);
-
- int version = getJavaVersion();
- System.out.println("Your Java version is: " + version);
-
- // At this point, the default protocol is SSLv3.
- // Possible values are TLSv1.2, TLSv1.1, TLSv1 & SSLv3
- // These are defined by the SSLSecurityProtocol enum
- // Java 8 disables SSLv3 by default
- System.out.println("Now trying to connect to Splunk using SSLv3");
- try {
- Service.setSslSecurityProtocol(SSLSecurityProtocol.SSLv3);
- Service serviceSSLv3 = Service.connect(command.opts);
- serviceSSLv3.login();
- System.out.println("\t Success!");
- } catch (RuntimeException e) {
- System.out.println("\t Failure! ");
- }
-
- // TLSv1 is available by default in every modern version of Java
- System.out.println("Now trying to connect to Splunk using TLSv1");
- try {
- Service.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1);
- Service serviceTLSv1 = Service.connect(command.opts);
- serviceTLSv1.login();
- System.out.println("\t Success!");
- } catch (RuntimeException e) {
- System.out.println("\t Failure! ");
- }
-
-
- // TLSv1.1 is available by default in Java 7 and up
- System.out.println("Now trying to connect to Splunk using TLSv1.1");
- try {
- Service.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1_1);
- Service serviceTLSv1_1 = Service.connect(command.opts);
- serviceTLSv1_1.login();
- System.out.println("\t Success!");
- } catch (RuntimeException e) {
- System.out.println("\t Failure! ");
- }
-
- // TLSv1.2 is available by default in Java 7 and up
- System.out.println("Now trying to connect to Splunk using TLSv1.2");
- try {
- Service.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1_2);
- Service serviceTLSv1_2 = Service.connect(command.opts);
- serviceTLSv1_2.login();
- System.out.println("\t Success!");
- } catch (RuntimeException e) {
- System.out.println("\t Failure! ");
- }
-
- // You can also specify your own SSLSocketFactory, in this case any version of SSL
- System.out.println("Now trying to connect to Splunk using a custom SSL only SSLSocketFactory");
- try {
- // Create an SSLSocketFactory configured to use SSL only
- SSLContext sslContext = SSLContext.getInstance("SSL");
- TrustManager[] byPassTrustManagers = new TrustManager[]{
- new X509TrustManager() {
- public X509Certificate[] getAcceptedIssuers() {
- return null;
- }
-
- public void checkClientTrusted(X509Certificate[] chain, String authType) {
- }
-
- public void checkServerTrusted(X509Certificate[] chain, String authType) {
- }
- }
- };
- sslContext.init(null, byPassTrustManagers, new SecureRandom());
- SSLSocketFactory SSLOnlySSLFactory = sslContext.getSocketFactory();
- Service.setSSLSocketFactory(SSLOnlySSLFactory);
-
- Service serviceCustomSSLFactory = Service.connect(command.opts);
- serviceCustomSSLFactory.login();
- System.out.println("\t Success!");
- } catch (Exception e) {
- System.out.println("\t Failure!");
- }
-
- // You can also specify your own SSLSocketFactory, in this case any version of TLS
- System.out.println("Now trying to connect to Splunk using a custom TLS only SSLSocketFactory");
- try {
- // Create an SSLSocketFactory configured to use TLS only
- SSLContext sslContext = SSLContext.getInstance("TLS");
- TrustManager[] byPassTrustManagers = new TrustManager[]{
- new X509TrustManager() {
- public X509Certificate[] getAcceptedIssuers() {
- return null;
- }
-
- public void checkClientTrusted(X509Certificate[] chain, String authType) {
- }
-
- public void checkServerTrusted(X509Certificate[] chain, String authType) {
- }
- }
- };
- sslContext.init(null, byPassTrustManagers, new SecureRandom());
- SSLSocketFactory TLSOnlySSLFactory = sslContext.getSocketFactory();
- Service.setSSLSocketFactory(TLSOnlySSLFactory);
-
- Service serviceCustomSSLFactory = Service.connect(command.opts);
- serviceCustomSSLFactory.login();
- System.out.println("\t Success!");
- } catch (Exception e) {
- System.out.println("\t Failure!");
- }
- }
-}
\ No newline at end of file
diff --git a/examples/src/main/java/com/splunk/examples/tail/Program.java b/examples/src/main/java/com/splunk/examples/tail/Program.java
deleted file mode 100644
index 6f2b7543..00000000
--- a/examples/src/main/java/com/splunk/examples/tail/Program.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk.examples.tail;
-
-import com.splunk.*;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-
-/**
- * Tail an index
- */
-
-public class Program {
-
- static String outputModeText =
- "Search output format {csv, raw, json, xml} (default: xml)";
-
- public static void main(String[] args) {
- try {
- run(args);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- static void run(String[] argsIn) throws Exception {
-
- Command command = Command.splunk("tail");
- command.addRule("format", String.class, outputModeText);
- command.parse(argsIn);
-
- if (command.args.length != 1)
- Command.error("Search expression required");
- String query = command.args[0];
-
- Service service = Service.connect(command.opts);
-
- String outputMode = "csv";
- if (command.opts.containsKey("format"))
- outputMode = (String)command.opts.get("format");
- Args args = new Args();
-
- // search args
- args.put("timeout", "60"); // Don't keep search around
- args.put("output_mode", outputMode); // Output in specific format
- args.put("earliest_time", "rt"); // Realtime
- args.put("latest_time", "rt"); // Realtime
- args.put("search_mode", "realtime"); // Realtime
-
- InputStream is = service.export(query, args);
-
- // Use UTF8 sensitive reader/writers
- InputStreamReader reader = new InputStreamReader(is, "UTF-8");
- OutputStreamWriter writer = new OutputStreamWriter(System.out);
-
- int size = 1024;
- char[] buffer = new char[size];
- while (true) {
- int count = reader.read(buffer);
- if (count == -1) break;
- writer.write(buffer, 0, count);
- writer.flush();
- }
- }
-}
diff --git a/examples/src/main/java/com/splunk/examples/testupdate/Program.java b/examples/src/main/java/com/splunk/examples/testupdate/Program.java
deleted file mode 100644
index 127b3746..00000000
--- a/examples/src/main/java/com/splunk/examples/testupdate/Program.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.splunk.examples.testupdate;
-
-/**
- * Created with IntelliJ IDEA.
- * User: fross
- * Date: 11/4/13
- * Time: 1:56 PM
- * To change this template use File | Settings | File Templates.
- */
-public class Program {
-}
diff --git a/index.html b/index.html
new file mode 100644
index 00000000..c7767348
--- /dev/null
+++ b/index.html
@@ -0,0 +1,37 @@
+
+
+
+
+
+ Java SDK redirect page
+
+
+
+
+
+
+
+
diff --git a/launchers/README.md b/launchers/README.md
deleted file mode 100644
index a13675d6..00000000
--- a/launchers/README.md
+++ /dev/null
@@ -1,85 +0,0 @@
-# Modular input launchers for the Splunk Enterprise SDK for Java
-
-Splunk Enterprise cannot launch Java programs as modular inputs directly. Instead, we need to provide a few small programs to launch a JVM and run a program. Since modular inputs written in Java need to work across all Splunk variants, including the universal forwarder, the launchers cannot rely on Python or anything else in the underlying system. Instead, we provide a set of C programs compiled for each of Linux, MacOS X, and Windows.
-
-The programs assume the following layout in an app: a jars/ directory containing a launchable jar containing the modular input, and a configuration file with a .ini suffix of the same base name that contains options for what JVM to launch and what options to pass to it. Then platform specific bin directories contain the launcher programs, named the base name of the target jar. For for a jar named myinput.jar, the layout would be
-
-myapp/
- jars/
- myinput.jar
- myinput.ini
- linux_x86/
- myinput
- linux_x86_64/
- myinput
- darwin_x86_64/
- myinput
- windows_x86/
- myinput.exe
- windows_x86_64/
- myinput.exe
-
-The configuration file should have the form
-
-JAVA_HOME=/path/to/jre
-JAVA_OPTS=options to pass to JVM
-
-The keys are case insensitive, and leading whitespace and whitespace around the equals sign is ignored.
-
-The POSIX launchers use the exec system call to replace the launcher with a JVM with the proper arguments. The Windows launcher starts the JVM with a call to CreateProcess, forwards exit events, and monitors the JVM it launches for termination.
-
-Testing story:
-
-http://stackoverflow.com/questions/65820/unit-testing-c-code
-
-There are a lot of options.
-
-
-
-Windows:
-
-Use GetModuleFileName(NULL) to get current name and path of this executable.
-
-For Linux,
-
- char *resolved_path = realpath("/proc/self/exe", NULL);
- printf("%s\n", resolved_path);
- free(resolved_path);
-
-/proc/pid/exe on Linux and /proc/pid/file on BSD are symlinks to the executable. Call readlink to resolve the symlink to get the path.
-
-On OS X, there are two ways:
-http://stackoverflow.com/questions/799679/programatically-retrieving-the-absolute-path-of-an-os-x-command-line-app/1024933#1024933
-libproc.h has proc_pidpath
-_NSGetExecutablePath in dyld
-
-#include
-#include
-#include
-#include
-#include
-
-int main (int argc, char* argv[])
-{
- int ret;
- pid_t pid;
- char pathbuf[PROC_PIDPATHINFO_MAXSIZE];
-
- pid = getpid();
- ret = proc_pidpath (pid, pathbuf, sizeof(pathbuf));
- if ( ret <= 0 ) {
- fprintf(stderr, "PID %d: proc_pidpath ();\n", pid);
- fprintf(stderr, " %s\n", strerror(errno));
- } else {
- printf("proc %d: %s\n", pid, pathbuf);
- }
-
- return 0;
-}
-
-proc_pidpath looks like the way to go. I'll test it.
-
-To exec the program:
-
- char* args[] = {"java", "-jar", "braindead.jar", NULL};
- execvp("java", args);
diff --git a/launchers/shim-darwin.sh b/launchers/shim-darwin.sh
deleted file mode 100755
index 145f1e46..00000000
--- a/launchers/shim-darwin.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-# Shim to run a modular input written in Java. The modular input
-# is assumed to be in the form of an executable jar. This shim
-# is in ${PLATFORM}/bin/${INPUTNAME}.sh of the app the modular
-# input is contained in, and the jar is assumed to be in
-# jars/${INPUTNAME}.jar in the app.
-#
-# If ${PLATFORM}/bin/customized.java.path exists, this script will
-# use java cmd defined in this file to start jvm, else default java
-# will be used.
-#
-# Extra arguments to the JVM (i.e., -Xms512M) can be put in
-# a file jars/${INPUTNAME}.vmopts and will be interpolated
-# into the command to run the JVM.
-SCRIPT="$0"
-
-cd `dirname "$SCRIPT"`
-SCRIPT=`basename "$SCRIPT"`
-
-while [ -L "$SCRIPT" ]; do
- SCRIPT=`readlink "$SCRIPT"`
- cd `dirname "$SCRIPT"`
- SCRIPT=`basename "$SCRIPT"`
-done
-
-BASENAME=$(basename "$SCRIPT" .sh)
-JAR_DIR=`pwd -P`/../../jars
-CUSTOMIZED_JAVA_PATH_FILE=`pwd -P`/customized.java.path
-
-if [ -f $CUSTOMIZED_JAVA_PATH_FILE ]; then
- JAVA_CMD=`cat $CUSTOMIZED_JAVA_PATH_FILE`
-else
- JAVA_CMD="java"
-fi
-
-if [ -f $JAR_DIR/$BASENAME.vmopts ]; then
- VMOPTS=`cat $JAR_DIR/$BASENAME.vmopts`
-else
- VMOPTS=""
-fi
-
-exec $JAVA_CMD $VMOPTS -jar $JAR_DIR/$BASENAME.jar $@
-
diff --git a/launchers/shim-linux.sh b/launchers/shim-linux.sh
deleted file mode 100755
index e0676451..00000000
--- a/launchers/shim-linux.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-# Shim to run a modular input written in Java. The modular input
-# is assumed to be in the form of an executable jar. This shim
-# is in ${PLATFORM}/bin/${INPUTNAME}.sh of the app the modular
-# input is contained in, and the jar is assumed to be in
-# jars/${INPUTNAME}.jar in the app.
-#
-# If ${PLATFORM}/bin/customized.java.path exists, this script will
-# use java cmd defined in this file to start jvm, else default java
-# will be used.
-#
-# Extra arguments to the JVM (i.e., -Xms512M) can be put in
-# a file jars/${INPUTNAME}.vmopts and will be interpolated
-# into the command to run the JVM.
-SCRIPT=$(readlink -f "$0")
-BASENAME=$(basename "$SCRIPT" .sh)
-JAR_DIR=$(dirname "$SCRIPT")/../../jars
-CUSTOMIZED_JAVA_PATH_FILE=$(dirname "$SCRIPT")/customized.java.path
-
-if [ -f $CUSTOMIZED_JAVA_PATH_FILE ]; then
- JAVA_CMD=`cat $CUSTOMIZED_JAVA_PATH_FILE`
-else
- JAVA_CMD="java"
-fi
-
-if [ -f $JAR_DIR/$BASENAME.vmopts ]; then
- VMOPTS=`cat $JAR_DIR/$BASENAME.vmopts`
-else
- VMOPTS=""
-fi
-
-exec $JAVA_CMD $VMOPTS -jar $JAR_DIR/$BASENAME.jar $@
\ No newline at end of file
diff --git a/launchers/shim-windows_x86.exe b/launchers/shim-windows_x86.exe
deleted file mode 100755
index 3ec87105..00000000
Binary files a/launchers/shim-windows_x86.exe and /dev/null differ
diff --git a/launchers/shim-windows_x86_64.exe b/launchers/shim-windows_x86_64.exe
deleted file mode 100755
index ffb1f4fc..00000000
Binary files a/launchers/shim-windows_x86_64.exe and /dev/null differ
diff --git a/launchers/shim/jars/shim.jar b/launchers/shim/jars/shim.jar
deleted file mode 100755
index cc5440c1..00000000
Binary files a/launchers/shim/jars/shim.jar and /dev/null differ
diff --git a/launchers/shim/jars/shim.vmopts b/launchers/shim/jars/shim.vmopts
deleted file mode 100755
index 2b72e100..00000000
--- a/launchers/shim/jars/shim.vmopts
+++ /dev/null
@@ -1 +0,0 @@
--Xms512M
\ No newline at end of file
diff --git a/launchers/shim/shim.sln b/launchers/shim/shim.sln
deleted file mode 100755
index 67987d0b..00000000
--- a/launchers/shim/shim.sln
+++ /dev/null
@@ -1,26 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shim", "shim\shim.vcxproj", "{830BB6EA-1A0C-4BFB-BD9B-E36F39ABF21C}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {830BB6EA-1A0C-4BFB-BD9B-E36F39ABF21C}.Debug|Win32.ActiveCfg = Debug|x64
- {830BB6EA-1A0C-4BFB-BD9B-E36F39ABF21C}.Debug|Win32.Build.0 = Debug|x64
- {830BB6EA-1A0C-4BFB-BD9B-E36F39ABF21C}.Debug|x64.ActiveCfg = Debug|x64
- {830BB6EA-1A0C-4BFB-BD9B-E36F39ABF21C}.Debug|x64.Build.0 = Debug|x64
- {830BB6EA-1A0C-4BFB-BD9B-E36F39ABF21C}.Release|Win32.ActiveCfg = Release|Win32
- {830BB6EA-1A0C-4BFB-BD9B-E36F39ABF21C}.Release|Win32.Build.0 = Release|Win32
- {830BB6EA-1A0C-4BFB-BD9B-E36F39ABF21C}.Release|x64.ActiveCfg = Release|x64
- {830BB6EA-1A0C-4BFB-BD9B-E36F39ABF21C}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/launchers/shim/shim.v11.suo b/launchers/shim/shim.v11.suo
deleted file mode 100755
index d173cadb..00000000
Binary files a/launchers/shim/shim.v11.suo and /dev/null differ
diff --git a/launchers/shim/shim/ReadMe.txt b/launchers/shim/shim/ReadMe.txt
deleted file mode 100755
index 8672406b..00000000
--- a/launchers/shim/shim/ReadMe.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-========================================================================
- CONSOLE APPLICATION : shim Project Overview
-========================================================================
-
-AppWizard has created this shim application for you.
-
-This file contains a summary of what you will find in each of the files that
-make up your shim application.
-
-
-shim.vcxproj
- This is the main project file for VC++ projects generated using an Application Wizard.
- It contains information about the version of Visual C++ that generated the file, and
- information about the platforms, configurations, and project features selected with the
- Application Wizard.
-
-shim.vcxproj.filters
- This is the filters file for VC++ projects generated using an Application Wizard.
- It contains information about the association between the files in your project
- and the filters. This association is used in the IDE to show grouping of files with
- similar extensions under a specific node (for e.g. ".cpp" files are associated with the
- "Source Files" filter).
-
-shim.cpp
- This is the main application source file.
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
- These files are used to build a precompiled header (PCH) file
- named shim.pch and a precompiled types file named StdAfx.obj.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" comments to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////
diff --git a/launchers/shim/shim/shim.cpp b/launchers/shim/shim/shim.cpp
deleted file mode 100755
index cbbf0778..00000000
--- a/launchers/shim/shim/shim.cpp
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * Copyright 2013 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-#include "stdafx.h"
-#include "shim.h"
-
-// Global variable used to let the Ctrl+C handler propogate Ctrl+C to the JVM.
-DWORD jvmPid = NULL;
-
-int _tmain(int argc, _TCHAR* argv[])
-{
- HANDLE processHandles[2] = {NULL, NULL};
- HANDLE &splunkdHandle = processHandles[0];
- HANDLE &jvmHandle = processHandles[1];
- HANDLE ghJob = NULL;
- PTSTR customizedJavaCmd = NULL, jarPath = NULL, jvmOptions = NULL, jvmCommandLine = NULL;
- DWORD waitOutcome;
- DWORD returnCode = 0;
-
- STARTUPINFO si;
- ZeroMemory(&si, sizeof(si));
- si.cb = sizeof(si);
-
- PROCESS_INFORMATION pi;
- ZeroMemory(&pi, sizeof(pi));
-
- SetConsoleCtrlHandler((PHANDLER_ROUTINE)killJvm, TRUE);
- splunkdHandle = getSplunkdHandle();
-
- if (NULL == splunkdHandle) {
- // Couldn't get a handle to splunkd.
- printErrorMessage(GetLastError());
-
- returnCode = 1;
- goto CLEAN_UP_AND_EXIT;
- }
-
- // create a job
- ghJob = CreateJobObject(NULL, NULL);
- if(ghJob == NULL) {
- printErrorMessage(GetLastError());
-
- returnCode = 1;
- goto CLEAN_UP_AND_EXIT;
- }else {
- JOBOBJECT_EXTENDED_LIMIT_INFORMATION jeli = { 0 };
-
- // Configure all child processes associated with the job to terminate when the main process terminated
- jeli.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
- if(0 == SetInformationJobObject(ghJob, JobObjectExtendedLimitInformation, &jeli, sizeof(jeli))) {
- printErrorMessage(GetLastError());
-
- returnCode = 1;
- goto CLEAN_UP_AND_EXIT;
- }
- }
-
- customizedJavaCmd = getCustomizedJavaCmd();
- jarPath = getPathToJar();
- jvmOptions = readJvmOptions(jarPath);
- jvmCommandLine = assembleJvmCommand(customizedJavaCmd, jarPath, jvmOptions, argc, argv);
-
- if (!CreateProcess(NULL, jvmCommandLine, NULL, NULL, FALSE, CREATE_NEW_PROCESS_GROUP, NULL, NULL, &si, &pi)) {
- // Process creation failed.
- printErrorMessage(GetLastError(), jvmCommandLine);
-
- returnCode = 1;
- goto CLEAN_UP_AND_EXIT;
- }
-
- // bind java process to this job
- if(0 == AssignProcessToJobObject(ghJob, pi.hProcess)) {
- printErrorMessage(GetLastError());
-
- returnCode = 1;
- goto CLEAN_UP_AND_EXIT;
- }
-
- CloseHandle(pi.hThread); // CreateProcess gives us a handle to the initial thread of the new process, which we don't need.
- jvmHandle = pi.hProcess;
- jvmPid = pi.dwProcessId;
- waitOutcome = WaitForMultipleObjects(2, processHandles, FALSE, INFINITE);
-
- if (waitOutcome == WAIT_OBJECT_0) {
- // Splunkd has died
- GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0);
-
- goto CLEAN_UP_AND_EXIT;
- } else if (waitOutcome == WAIT_OBJECT_0 + 1) {
- // JVM has died
- if (!GetExitCodeProcess(jvmHandle, &returnCode)) {
- printErrorMessage(GetLastError());
- returnCode = 1;
- }
- goto CLEAN_UP_AND_EXIT;
- } else {
- // There was some other error
- printErrorMessage(GetLastError());
-
- returnCode = 1;
- goto CLEAN_UP_AND_EXIT;
- }
-
-CLEAN_UP_AND_EXIT:
- if (NULL != jvmCommandLine) LocalFree(jvmCommandLine);
- if (NULL != jvmOptions) LocalFree(jvmOptions);
- if (NULL != jarPath) LocalFree(jarPath);
- if (NULL != customizedJavaCmd) LocalFree(customizedJavaCmd);
-
- if (NULL != splunkdHandle) CloseHandle(splunkdHandle);
- if (NULL != jvmHandle) CloseHandle(jvmHandle);
- if (NULL != ghJob) CloseHandle(ghJob);
-
- return returnCode;
-}
-
-
-BOOL killJvm(DWORD interruptCode) {
- if (jvmPid != NULL) {
- GenerateConsoleCtrlEvent(interruptCode, jvmPid);
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
-
-void printErrorMessage(DWORD errorCode, ...) {
- LPTSTR buffer;
-
- va_list args = NULL;
- va_start(args, errorCode);
-
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER,
- NULL, errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&buffer, 0, &args);
-
- fwprintf(stderr, TEXT("ERROR %s\r\n"), buffer);
-
- LocalFree(buffer);
-}
-
-
-PTSTR readJvmOptions(PTSTR jarPath) {
- size_t jarPathLen = _tcslen(jarPath);
- // vmoptsPath is the same as jarPath, but ending with .vmopts instead of .jar. We allocate
- // 3 additional TCHARs for the additional length of .vmopts, and 1 more TCHAR for a NULL
- // terminator, so jarPathLen+4.
- PTSTR vmoptsPath = (PTSTR)malloc(sizeof(TCHAR) * (jarPathLen + 4));
- PTSTR suffixPtr = vmoptsPath;
-
- _tcscpy_s(vmoptsPath, jarPathLen+1, jarPath);
-
- suffixPtr = _tcsrchr(vmoptsPath, CHAR('.'));
- if (suffixPtr == 0) {
- SetLastError(ERROR_INVALID_DATA);
- return NULL;
- }
-
- _tcscpy_s(suffixPtr, 8, TEXT(".vmopts"));
-
- HANDLE vmoptsHandle = CreateFile(vmoptsPath, GENERIC_READ, FILE_SHARE_READ,
- NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-
- if (INVALID_HANDLE_VALUE == vmoptsHandle) {
- if (ERROR_FILE_NOT_FOUND == GetLastError() || ERROR_PATH_NOT_FOUND == GetLastError()) {
- // We can't return a literal because we will try to deallocate it later.
- free(vmoptsPath);
- vmoptsPath = (PTSTR)malloc(sizeof(TCHAR));
- _tcscpy_s(vmoptsPath, 1, TEXT(""));
- return vmoptsPath;
- } else {
- return NULL;
- }
- }
-
- DWORD fileSize = GetFileSize(vmoptsHandle, NULL);
- if (INVALID_FILE_SIZE == fileSize) {
- return NULL;
- }
-
- DWORD nRead;
- char* buffer = (char*)malloc((fileSize+1) * sizeof(char)); // +1 to give space for a NULL character.
- if (!ReadFile(vmoptsHandle, buffer, fileSize, &nRead, NULL)) {
- return NULL;
- }
- buffer[nRead] = NULL; // Ensure options are null terminated.
-
- if (NULL != vmoptsHandle) CloseHandle(vmoptsHandle);
-
-#ifdef _UNICODE
- // Calculate how much space is needed.
- DWORD nWchars = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, buffer, nRead, NULL, 0);
- wchar_t *vmopts = (wchar_t*)malloc(sizeof(wchar_t) * (nWchars+1));
- if (!MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, buffer, nRead, vmopts, nWchars)) {
- return NULL;
- }
- vmopts[nWchars] = NULL;
- return vmopts;
-#else
- return buffer;
-#endif
-}
-
-
-PTSTR assembleJvmCommand(PTSTR customizedJavaCmd, PTSTR jarPath, PTSTR jvmOptions, int argc, _TCHAR* argv[]) {
- PTSTR buffer, index;
- size_t len;
- int i;
-
- len = 0;
- for (i = 1; i < argc; i++) {
- len += _tcslen(argv[i]) + 1; // The +1 accounts for a space to separate the arguments
- }
-
- // 9 + max(command) = number of characters for java cmd and -jar sections; +1 at the end is for the null terminator.
- buffer = (PTSTR)malloc((9 + max(_tcslen(customizedJavaCmd), 4) + _tcslen(jarPath) + _tcslen(jvmOptions) + len + 1) * sizeof(TCHAR));
- index = buffer;
-
-#define APPEND_TCS(literal) { \
- _tcscpy_s(index, _tcslen(literal)+1, literal); \
- index += _tcslen(literal); \
-}
- if (NULL != customizedJavaCmd && 0 != _tcslen(customizedJavaCmd)) {
- APPEND_TCS(customizedJavaCmd);
- APPEND_TCS(TEXT(" "));
- } else {
- APPEND_TCS(TEXT("java "));
- }
- APPEND_TCS(jvmOptions);
- APPEND_TCS(TEXT(" -jar \""));
- APPEND_TCS(jarPath);
- APPEND_TCS(TEXT("\""));
-
- for (i = 1; i < argc; i++) {
- APPEND_TCS(TEXT(" "));
- APPEND_TCS(argv[i]);
- }
-
-#undef APPEND_TCS
-
- return buffer;
-}
-
-
-HANDLE getSplunkdHandle() {
- const TCHAR* SPLUNKD_HANDLE_ENVVAR = TEXT("SPLUNKD_PROCESSID");
-
- size_t bufferSize;
- TCHAR* pidBuffer;
- TCHAR* stopString;
-
- DWORD splunkdPid;
-
- // Find how large a buffer we need.
- _tgetenv_s(&bufferSize, NULL, 0, SPLUNKD_HANDLE_ENVVAR);
- if (bufferSize == 0) {
- SetLastError(ERROR_ENVVAR_NOT_FOUND);
- return NULL;
- }
-
- pidBuffer = (PTSTR)malloc(bufferSize * sizeof(TCHAR));
- if (_tgetenv_s(&bufferSize, pidBuffer, bufferSize, SPLUNKD_HANDLE_ENVVAR)) {
- return NULL; // There was an error in getting the environment variable.
- }
- splunkdPid = _tcstoul(pidBuffer, &stopString, 10);
-
- if (*stopString != NULL || splunkdPid == 0) {
- // We haven't parsed the whole environment variable as a number.
- SetLastError(ERROR_BAD_ENVIRONMENT);
- return NULL;
- }
-
- free(pidBuffer);
-
- return OpenProcess(SYNCHRONIZE, FALSE, splunkdPid);
-}
-
-
-PTSTR getPathToJar() {
- PTSTR thisPath, endPtr, baseName;
- PCTSTR jarPathFragment = TEXT("\\jars\\");
- const DWORD jarPathFragmentLen = 7;
- PCTSTR jarSuffix = TEXT(".jar");
- const DWORD jarSuffixLen = 5;
- const size_t N = 1024;
- size_t baseNameLen;
-
- thisPath = (PTSTR)malloc(N*sizeof(TCHAR));
- if (N == GetModuleFileName(NULL, thisPath, N) && ERROR_INSUFFICIENT_BUFFER == GetLastError()) {
- return NULL;
- }
-
- // The following code removes the last two path segments before the executable name in the buffer,
- // puts a \jars\ on the path, then shifts the base name of the executable over and adds .jar to it.
- // Graphically, with 0 representing null terminators, the steps are:
- //
- // 1. $SPLUNK_HOME$\etc\apps\myapp\windows_x86_64\bin\myinput.exe0
- // 2. $SPLUNK_HOME$\etc\apps\myapp\jars\0 myinput.exe0
- // 3. $SPLUNK_HOME$\etc\apps\myapp\jars\myinput0
- // 4. $SPLUNK_HOME$\etc\apps\myapp\jars\myinput.jar0
-
- // Find 'myinput.exe', just after the last \.
- endPtr = _tcsrchr(thisPath, '\\');
- baseName = endPtr+1; // This is 'myinput.exe'
- *endPtr = NULL; // NULL terminate the string before this point so we can strrchar to get the next \.
- endPtr = _tcsrchr(baseName, '.'); // Find .exe, and NULL terminate the base name.
- *endPtr = NULL;
-
- // Take two directory levels off this path.
- endPtr = _tcsrchr(thisPath, '\\');
- *endPtr = NULL;
- endPtr = _tcsrchr(thisPath, '\\');
-
- if ((size_t)(baseName-endPtr) < _tcslen(TEXT("\\jars\\"))) {
- return NULL; // Not enough space to copy the path fragment in without clobbering the jar name.
- }
-
- // Instead of NULL terminating, we copy \jars\ over top and advance to the end of it.
- _tcscpy_s(endPtr, jarPathFragmentLen, jarPathFragment);
- endPtr += jarPathFragmentLen - 1;
- // Now shift the base name over.
- baseNameLen = _tcslen(baseName) + 1;
- // Advance endPtr and add .jar to it.
- memmove_s(endPtr, baseNameLen*sizeof(TCHAR), baseName, baseNameLen*sizeof(TCHAR));
- endPtr += baseNameLen - 1;
- _tcscpy_s(endPtr, jarSuffixLen, jarSuffix);
-
- return thisPath;
-}
-
-PTSTR getCustomizedJavaCmd() {
- PTSTR javaHomePath, endPtr;
- PCTSTR javaHomeFragment = TEXT("\\customized.java.path");
- const DWORD javaHomeFragmentLen = 22;
- const size_t N = 1024;
-
- javaHomePath = (PTSTR)malloc(N*sizeof(TCHAR));
- if (N == GetModuleFileName(NULL, javaHomePath, N) && ERROR_INSUFFICIENT_BUFFER == GetLastError()) {
- return NULL;
- }
-
- // thisPath is: $SPLUNK_HOME$\etc\apps\myapp\windows_x86_64\bin\myinput.exe0
- // Take three directory levels off this path.
- endPtr = _tcsrchr(javaHomePath, '\\');
- _tcscpy_s(endPtr, javaHomeFragmentLen, javaHomeFragment);
- endPtr += javaHomeFragmentLen;
- *endPtr = NULL;
-
- HANDLE javaHomeHandle = CreateFile(javaHomePath, GENERIC_READ, FILE_SHARE_READ,
- NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-
- if (INVALID_HANDLE_VALUE == javaHomeHandle) {
- if (ERROR_FILE_NOT_FOUND == GetLastError() || ERROR_PATH_NOT_FOUND == GetLastError()) {
- // We can't return a literal because we will try to deallocate it later.
- free(javaHomePath);
- javaHomePath = (PTSTR)malloc(sizeof(TCHAR));
- _tcscpy_s(javaHomePath, 1, TEXT(""));
- return javaHomePath;
- } else {
- return NULL;
- }
- }
-
- DWORD fileSize = GetFileSize(javaHomeHandle, NULL);
- if (INVALID_FILE_SIZE == fileSize) {
- return NULL;
- }
-
- DWORD nRead;
- char* buffer = (char*)malloc((fileSize+1) * sizeof(char)); // +1 to give space for a NULL character.
- if (!ReadFile(javaHomeHandle, buffer, fileSize, &nRead, NULL)) {
- return NULL;
- }
- buffer[nRead] = NULL; // Ensure options are null terminated.
-
- if (NULL != javaHomeHandle) CloseHandle(javaHomeHandle);
-
-#ifdef _UNICODE
- // Calculate how much space is needed.
- DWORD nWchars = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, buffer, nRead, NULL, 0);
- wchar_t *javaHome = (wchar_t*)malloc(sizeof(wchar_t) * (nWchars+1));
- if (!MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, buffer, nRead, javaHome, nWchars)) {
- return NULL;
- }
- javaHome[nWchars] = NULL;
- return javaHome;
-#else
- return buffer;
-#endif
-}
diff --git a/launchers/shim/shim/shim.h b/launchers/shim/shim/shim.h
deleted file mode 100755
index 7c86df56..00000000
--- a/launchers/shim/shim/shim.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2013 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * shim - Windows launcher for Splunk modular inputs written in Java.
- *
- * shim is provided as both 32-bit and 64-bit binaries. If you are setting up a
- * modular input written in Java in your app, you should make it into an executable
- * jar, and put it in a jars/ directory in your app. The jar should be named the
- * with the same name as the modular input kind defined in Splunk. That is, if your
- * stanza in README/inputs.conf.spec that defines the modular input kind is called
- * 'myinput', then the jar should be in jars/myinput.jar. You can create a UTF-8 encoded
- * text file in jars/myinput.vmopts that contains options to pass to java when creating
- * the virtual machine (i.e., -Xms512M -agent something.jar).
- *
- * Then place the 32-bit binary of shim in windows_x86/bin/myinput.exe and the 64-bit
- * binary in windows_x86_64/bin/myinput.exe (changing 'myinput' to the name of your modular
- * input kind). Splunk will launch them and they in turn will look for the jar,
- * launch it, and handle all the control signals from Splunk.
- *
- * Once shim starts and executes the JVM, it waits for Ctrl+C from Splunk or for splunkd
- * to die. If either of these events occurs, it sends Ctrl+C to the JVM, waits for it
- * to exit, and exits itself. If the JVM exits, the shim exits immediately thereafter.
- */
-
-
-#ifndef __SHIM_H__
-#define __SHIM_H__
-
-#include
-
-/**
- * Returns a HANDLE referring to splunkd's process, or NULL if it could
- * not find such a handle. Use GetLastError to find the error in that case.
- *
- * When splunkd starts a modular input script, it sets its pid as the value of
- * an environment variable SPLUNKD_PROCESSID.
- */
-HANDLE getSplunkdHandle();
-
-
-/**
- * Return a PTSTR with the path to the Java jar, or NULL if no path could be constructed.
- *
- * The jar is taken to be at ../../jars/{name}.jar from the location of the current executable,
- * if the name of the current executable is {name}.exe.
- */
-PTSTR getPathToJar();
-
-
-/**
- * Returns the contents of a file with the same base name as the Jar referred to in jarPath,
- * but with the suffix .vmopts (so for path\to\myinput.jar, reads path\to\myinputs.vmptops).
- *
- * This function is meant to read the options for the JVM (i.e., -Xms512M) so they can be
- * added to the command line. If there is an error that prevents reading the file (the jar path
- * does not end in .jar, or it cannot be read), readJvmOptions returns NULL and sets an error
- * code retrievable with GetLastError. If the file does not exist, readJvmOptions returns an
- * empty string.
- */
-PTSTR readJvmOptions(PTSTR pathToJar);
-
-/**
- * get the customized java command
- */
-PTSTR getCustomizedJavaCmd();
-
-/**
- * Construct the full command to run the jar. This will return a new buffer containing
- *
- * java [jvmOptions] -jar "[jarPath]" [argv[0]] [argv[1]] ...
- */
-PTSTR assembleJvmCommand(PTSTR customizedJavaCmd, PTSTR pathToJar, PTSTR jvmOptions, int argc, _TCHAR* argv[]);
-
-
-/**
- * Print an error message to stderr containing the human readable error message
- * corresponding to the GetLastError's return value.
- */
-void printErrorMessage(DWORD errorCode, ...);
-
-
-/**
- * A PHANDLER_ROUTINE to handle receiving console control events such as
- * Ctrl+C. Upon receiving a console control event, it sends the same event
- * to the JVM (which it finds via the PID stored in the global jvmPid
- * variable).
- *
- * The handler does not further shutdown, since as soon as the JVM dies,
- * the standard logic in _tmain will handle exiting this program as well.
- */
-BOOL killJvm(DWORD interruptCode);
-
-#endif
\ No newline at end of file
diff --git a/launchers/shim/shim/shim.vcxproj b/launchers/shim/shim/shim.vcxproj
deleted file mode 100755
index d72fed90..00000000
--- a/launchers/shim/shim/shim.vcxproj
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Debug
- x64
-
-
- Release
- Win32
-
-
- Release
- x64
-
-
-
- {830BB6EA-1A0C-4BFB-BD9B-E36F39ABF21C}
- Win32Proj
- shim
-
-
-
- Application
- true
- v110
- Unicode
-
-
- Application
- true
- v110
- Unicode
-
-
- Application
- false
- v110_xp
- true
- Unicode
-
-
- Application
- false
- v110_xp
- true
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
- true
-
-
- false
-
-
- false
-
-
-
- Use
- Level3
- Disabled
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- MultiThreadedDebug
-
-
- Console
- true
- RequireAdministrator
-
-
-
-
- Use
- Level3
- Disabled
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- MultiThreadedDebug
-
-
- Console
- true
- RequireAdministrator
-
-
-
-
- Level3
- Use
- MaxSpeed
- true
- true
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- MultiThreaded
-
-
- Console
- true
- true
- true
-
-
-
-
- Level3
- Use
- MaxSpeed
- true
- true
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- true
- MultiThreaded
-
-
- Console
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
- Create
- Create
- Create
- Create
-
-
-
-
-
-
\ No newline at end of file
diff --git a/launchers/shim/shim/shim.vcxproj.filters b/launchers/shim/shim/shim.vcxproj.filters
deleted file mode 100755
index e2e7ae36..00000000
--- a/launchers/shim/shim/shim.vcxproj.filters
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
-
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/launchers/shim/shim/shim.vcxproj.user b/launchers/shim/shim/shim.vcxproj.user
deleted file mode 100755
index 6fcdb2ce..00000000
--- a/launchers/shim/shim/shim.vcxproj.user
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
- SPLUNKD_PROCESSID=1416
-$(LocalDebuggerEnvironment)
- WindowsLocalDebugger
-
-
- SPLUNKD_PROCESSID=1416$(LocalDebuggerEnvironment)
- WindowsLocalDebugger
-
-
-
-
- --scheme
- SPLUNKD_PROCESSID=1416
- WindowsLocalDebugger
-
-
- SPLUNKD_PROCESSID=1416
- WindowsLocalDebugger
-
-
\ No newline at end of file
diff --git a/launchers/shim/shim/stdafx.cpp b/launchers/shim/shim/stdafx.cpp
deleted file mode 100755
index ccd66401..00000000
--- a/launchers/shim/shim/stdafx.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// shim.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
diff --git a/launchers/shim/shim/stdafx.h b/launchers/shim/shim/stdafx.h
deleted file mode 100755
index 47a0d025..00000000
--- a/launchers/shim/shim/stdafx.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#include "targetver.h"
-
-#include
-#include
-
-
-
-// TODO: reference additional headers your program requires here
diff --git a/launchers/shim/shim/targetver.h b/launchers/shim/shim/targetver.h
deleted file mode 100755
index 90e767bf..00000000
--- a/launchers/shim/shim/targetver.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma once
-
-// Including SDKDDKVer.h defines the highest available Windows platform.
-
-// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
-// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
-
-#include
diff --git a/licenses/LICENSE-COMMONS b/licenses/LICENSE-COMMONS
deleted file mode 100644
index 7a4a3ea2..00000000
--- a/licenses/LICENSE-COMMONS
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
diff --git a/licenses/LICENSE-GSON b/licenses/LICENSE-GSON
deleted file mode 100644
index 7a4a3ea2..00000000
--- a/licenses/LICENSE-GSON
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
diff --git a/licenses/LICENSE-JACOCO b/licenses/LICENSE-JACOCO
deleted file mode 100644
index e19f0de1..00000000
--- a/licenses/LICENSE-JACOCO
+++ /dev/null
@@ -1,74 +0,0 @@
-Eclipse Public License - v 2.0
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-1. DEFINITIONS
-“Contribution” means:
-
-a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-i) changes to the Program, and
-ii) additions to the Program;
-where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution “originates” from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works.
-“Contributor” means any person or entity that Distributes the Program.
-
-“Licensed Patents” mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
-
-“Program” means the Contributions Distributed in accordance with this Agreement.
-
-“Recipient” means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors.
-
-“Derivative Works” shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship.
-
-“Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof.
-
-“Distribute” means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy.
-
-“Source Code” means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-“Secondary License” means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor.
-
-2. GRANT OF RIGHTS
-a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works.
-b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
-c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
-d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
-e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3).
-3. REQUIREMENTS
-3.1 If a Contributor Distributes the Program in any form, then:
-
-a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and
-b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license:
-i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
-ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
-iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and
-iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3.
-3.2 When the Program is Distributed as Source Code:
-
-a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and
-b) a copy of this Agreement must be included with each copy of the Program.
-3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability (‘notices’) contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices.
-
-4. COMMERCIAL DISTRIBUTION
-Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (“Commercial Contributor”) hereby agrees to defend and indemnify every other Contributor (“Indemnified Contributor”) against any losses, damages and costs (collectively “Losses”) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
-
-5. NO WARRANTY
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
-
-6. DISCLAIMER OF LIABILITY
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-7. GENERAL
-If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version.
-
-Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement.
-
-Exhibit A – Form of Secondary Licenses Notice
-“This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}.”
\ No newline at end of file
diff --git a/licenses/LICENSE-JUNIT b/licenses/LICENSE-JUNIT
deleted file mode 100644
index 3fa00836..00000000
--- a/licenses/LICENSE-JUNIT
+++ /dev/null
@@ -1,86 +0,0 @@
-Eclipse Public License - v 1.0
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-1. DEFINITIONS
-
-"Contribution" means:
-
-a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
-
-b) in the case of each subsequent Contributor:
-
-i) changes to the Program, and
-
-ii) additions to the Program;
-
-where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
-
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this Agreement.
-
-"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
-
-2. GRANT OF RIGHTS
-
-a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
-
-b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
-
-c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
-
-d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
-
-3. REQUIREMENTS
-
-A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
-
-a) it complies with the terms and conditions of this Agreement; and
-
-b) its license agreement:
-
-i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
-
-ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
-
-iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
-
-iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
-
-When the Program is made available in source code form:
-
-a) it must be made available under this Agreement; and
-
-b) a copy of this Agreement must be included with each copy of the Program.
-
-Contributors may not remove or alter any copyright notices contained within the Program.
-
-Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
-
-4. COMMERCIAL DISTRIBUTION
-
-Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
-
-5. NO WARRANTY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
-
-6. DISCLAIMER OF LIABILITY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-7. GENERAL
-
-If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
\ No newline at end of file
diff --git a/licenses/LICENSE-NETBEANS b/licenses/LICENSE-NETBEANS
deleted file mode 100644
index 4c9ad980..00000000
--- a/licenses/LICENSE-NETBEANS
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/licenses/LICENSE-OPENCSV b/licenses/LICENSE-OPENCSV
deleted file mode 100644
index 8ca90d00..00000000
--- a/licenses/LICENSE-OPENCSV
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 37ef9e19..00000000
--- a/pom.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
- 4.0.0
-
-
- 1.9.5
- true
- UTF-8
- 8
- 8
-
-
- com.splunk
- splunk-sdk-java
- 1.0.1
- pom
- Splunk SDK for Java
- https://dev.splunk.com/enterprise/docs/devtools/java/sdk-java
-
-
-
- com.google.code.gson
- gson
- 2.8.9
-
-
- net.sf.opencsv
- opencsv
- 2.3
-
-
-
- splunk
- examples
-
-
-
- package
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.1
-
- ${maven.compiler.source}
- ${maven.compiler.target}
-
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
- 3.0.0-M1
-
- false
-
-
-
-
-
-
-
- splunk-artifactory
- Splunk Releases
- https://splunk.jfrog.io/splunk/ext-releases-local
-
-
-
-
-
- splunk-artifactory
- Splunk Releases
- https://splunk.jfrog.io/splunk/ext-releases-local
-
-
-
-
-
- The Apache Software License, Version 2.0
- http://www.apache.org/licenses/LICENSE-2.0.txt
- repo
-
-
-
-
- Splunk, Inc.
- http://dev.splunk.com
-
-
diff --git a/results.json b/results.json
deleted file mode 100644
index bae99b06..00000000
--- a/results.json
+++ /dev/null
@@ -1,2 +0,0 @@
-
-{"preview":false,"init_offset":0,"messages":[{"type":"DEBUG","text":"base lispy: [ AND index::_internal ]"},{"type":"DEBUG","text":"search context: user=\"admin\", app=\"search\", bs-pathname=\"/Users/fross/splunks/splunk-5.0/etc\""}],"fields":["_bkt","_cd","_indextime","_raw","_serial","_si","_sourcetype","_subsecond","_time","host","index","linecount","source","sourcetype","splunk_server"],"rows":[["_internal~31~02DF1FF2-4F8D-4766-BCCD-4859C4AB3380","31:25618","1351880441","127.0.0.1 - - [02/Nov/2012:11:20:40.353 -0700] \"POST /services/search/jobs HTTP/1.1\" 400 191 - - - 1ms","0",["fross-mbp15.local","_internal"],"splunkd_access",".353","2012-11-02T11:20:40.353-07:00","fross-mbp15.local","_internal","1","/Users/fross/splunks/splunk-5.0/var/log/splunk/splunkd_access.log","splunkd_access","fross-mbp15.local"],["_internal~31~02DF1FF2-4F8D-4766-BCCD-4859C4AB3380","31:25610","1351880437","11-02-2012 11:20:37.093 -0700 INFO Metrics - group=udpin_connections, *:9999, sourcePort=9999, _udp_bps=0.00, _udp_kbps=0.00, _udp_avg_thruput=0.00, _udp_kprocessed=0.00, _udp_eps=0.00","1",["fross-mbp15.local","_internal"],"splunkd",".093","2012-11-02T11:20:37.093-07:00","fross-mbp15.local","_internal","1","/Users/fross/splunks/splunk-5.0/var/log/splunk/metrics.log","splunkd","fross-mbp15.local"],["_internal~31~02DF1FF2-4F8D-4766-BCCD-4859C4AB3380","31:25605","1351880437","11-02-2012 11:20:37.093 -0700 INFO Metrics - group=tpool, name=indexertpool, qsize=0, workers=6, qwork_units=0","2",["fross-mbp15.local","_internal"],"splunkd",".093","2012-11-02T11:20:37.093-07:00","fross-mbp15.local","_internal","1","/Users/fross/splunks/splunk-5.0/var/log/splunk/metrics.log","splunkd","fross-mbp15.local"],["_internal~31~02DF1FF2-4F8D-4766-BCCD-4859C4AB3380","31:25600","1351880437","11-02-2012 11:20:37.093 -0700 INFO Metrics - group=tpool, name=bundlereplthreadpool, qsize=0, workers=0, qwork_units=0","3",["fross-mbp15.local","_internal"],"splunkd",".093","2012-11-02T11:20:37.093-07:00","fross-mbp15.local","_internal","1","/Users/fross/splunks/splunk-5.0/var/log/splunk/metrics.log","splunkd","fross-mbp15.local"],["_internal~31~02DF1FF2-4F8D-4766-BCCD-4859C4AB3380","31:25595","1351880437","11-02-2012 11:20:37.093 -0700 INFO Metrics - group=tpool, name=batchreadertpool, qsize=0, workers=1, qwork_units=0","4",["fross-mbp15.local","_internal"],"splunkd",".093","2012-11-02T11:20:37.093-07:00","fross-mbp15.local","_internal","1","/Users/fross/splunks/splunk-5.0/var/log/splunk/metrics.log","splunkd","fross-mbp15.local"],["_internal~31~02DF1FF2-4F8D-4766-BCCD-4859C4AB3380","31:25578","1351880437","11-02-2012 11:20:37.093 -0700 INFO Metrics - group=subtask_seconds, task=indexer_service, replicate_semislice=0.000000, sync_hotBkt=0.000000, throttle_optimize=0.000765, flushBlockSig=0.000000, retryMove_1hotBkt=0.000000, size_hotBkt=0.000000, roll_hotBkt=0.000000, chillOrFreeze=0.000000, update_checksums=0.000000, fork_recovermetadata=0.000000, rebuild_metadata=0.000000, update_bktManifest=0.000000, service_volumes=0.000030, service_maxSizes=0.000015, service_externProc=0.000015","5",["fross-mbp15.local","_internal"],"splunkd",".093","2012-11-02T11:20:37.093-07:00","fross-mbp15.local","_internal","1","/Users/fross/splunks/splunk-5.0/var/log/splunk/metrics.log","splunkd","fross-mbp15.local"],["_internal~31~02DF1FF2-4F8D-4766-BCCD-4859C4AB3380","31:25572","1351880437","11-02-2012 11:20:37.093 -0700 INFO Metrics - group=search_concurrency, system total, active_hist_searches=0, active_realtime_searches=0","6",["fross-mbp15.local","_internal"],"splunkd",".093","2012-11-02T11:20:37.093-07:00","fross-mbp15.local","_internal","1","/Users/fross/splunks/splunk-5.0/var/log/splunk/metrics.log","splunkd","fross-mbp15.local"],["_internal~31~02DF1FF2-4F8D-4766-BCCD-4859C4AB3380","31:25567","1351880437","11-02-2012 11:20:37.093 -0700 INFO Metrics - group=realtime_search_data, system total, drop_count=0","7",["fross-mbp15.local","_internal"],"splunkd",".093","2012-11-02T11:20:37.093-07:00","fross-mbp15.local","_internal","1","/Users/fross/splunks/splunk-5.0/var/log/splunk/metrics.log","splunkd","fross-mbp15.local"],["_internal~31~02DF1FF2-4F8D-4766-BCCD-4859C4AB3380","31:25560","1351880437","11-02-2012 11:20:37.092 -0700 INFO Metrics - group=queue, name=udpin, max_size_kb=500, current_size_kb=0, current_size=0, largest_size=0, smallest_size=0","8",["fross-mbp15.local","_internal"],"splunkd",".092","2012-11-02T11:20:37.092-07:00","fross-mbp15.local","_internal","1","/Users/fross/splunks/splunk-5.0/var/log/splunk/metrics.log","splunkd","fross-mbp15.local"],["_internal~31~02DF1FF2-4F8D-4766-BCCD-4859C4AB3380","31:25553","1351880437","11-02-2012 11:20:37.092 -0700 INFO Metrics - group=queue, name=typingqueue, max_size_kb=500, current_size_kb=0, current_size=0, largest_size=48, smallest_size=0","9",["fross-mbp15.local","_internal"],"splunkd",".092","2012-11-02T11:20:37.092-07:00","fross-mbp15.local","_internal","1","/Users/fross/splunks/splunk-5.0/var/log/splunk/metrics.log","splunkd","fross-mbp15.local"]]}
\ No newline at end of file
diff --git a/run b/run
deleted file mode 100755
index 8d30444d..00000000
--- a/run
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2011 Splunk, Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"): you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-"""Helper script for running Java SDK examples."""
-
-from subprocess import Popen
-import sys
-
-if len(sys.argv) == 1: sys.exit(0)
-cmdline = "java -jar dist/examples/%s.jar" % sys.argv[1]
-cmdline = cmdline.split()
-cmdline.extend(sys.argv[2:])
-process = Popen(cmdline, env={})
-process.communicate()
-sys.exit(process.wait())
diff --git a/scripts/test_specific.sh b/scripts/test_specific.sh
deleted file mode 100644
index 34aac979..00000000
--- a/scripts/test_specific.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-echo "To run a specific test:"
-echo " mvn test -Dtest=[testclass]"
diff --git a/splunk/.classpath b/splunk/.classpath
deleted file mode 100644
index 233be1d2..00000000
--- a/splunk/.classpath
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/splunk/.project b/splunk/.project
deleted file mode 100644
index 05407fe4..00000000
--- a/splunk/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- Splunk
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
-
-
diff --git a/splunk/pom.xml b/splunk/pom.xml
deleted file mode 100644
index 7dede37e..00000000
--- a/splunk/pom.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
- 4.0.0
-
- splunk
- 1.9.5
-
- splunk-sdk-java
- com.splunk
- 1.0.1
-
-
- TLSv1.2
-
-
-
- junit
- junit
- 4.13.1
- test
-
-
- commons-cli
- commons-cli
- 1.2
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 3.2.0
-
-
- attach-sources
-
- jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 3.3.0
-
-
- attach-javadocs
-
- jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 3.0.0-M5
-
- ${skipTests}
- alphabetical
-
- ${https.protocols}
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
- 0.8.8
-
-
-
- prepare-agent
-
-
-
-
- report
- test
-
- report
-
-
- target/test-report
-
-
-
-
-
-
-
-
diff --git a/splunk/splunk.iml b/splunk/splunk.iml
deleted file mode 100644
index 2fbe4c0c..00000000
--- a/splunk/splunk.iml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/splunk/src/main/java/com/splunk/Application.java b/splunk/src/main/java/com/splunk/Application.java
deleted file mode 100644
index 6e44068a..00000000
--- a/splunk/src/main/java/com/splunk/Application.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-/**
- * The {@code Application} class represents a locally-installed Splunk app.
- */
-public class Application extends Entity {
-
- /**
- * Class constructor.
- *
- * @param service The connected {@code Service} instance.
- * @param path The application endpoint.
- */
- Application(Service service, String path) {
- super(service, path);
- }
-
- /**
- * Returns the name of the app's author. For Splunkbase
- * apps, this value is the username of the Splunk.com account. For internal
- * apps, this value is the full name.
- *
- * @return The author name, or {@code null} if not specified.
- */
- public String getAuthor() {
- return getString("author", null);
- }
-
- /**
- * Indicates whether Splunk checks Splunkbase for updates.
- *
- * @return {@code true} if Splunk checks Splunkbase for app updates,
- * {@code false} if not.
- */
- public boolean getCheckForUpdates() {
- return getBoolean("check_for_updates", false);
- }
-
- /**
- * Returns a short description of the app.
- *
- * @return The description, or {@code null} if not specified.
- */
- public String getDescription() {
- return getString("description", null);
- }
-
- /**
- * Returns the app's label (its name).
- *
- * @return The label, or {@code null} if not specified.
- */
- public String getLabel() {
- return getString("label", null);
- }
-
- /**
- * Indicates whether to reload objects contained in the locally-installed
- * app.
- *
- * @return {@code true} if objects are reloaded, {@code false} if not.
- */
- public boolean getRefresh() {
- return getBoolean("refresh", false);
- }
-
- /**
- * Returns the version of the app.
- *
- * @return The version, or {@code null} if not specified.
- */
- public String getVersion() {
- return getString("version", null);
- }
-
- /**
- * Indicates whether the app's custom setup has been
- * performed. This field is available in Splunk version 4.2.4 and later.
- *
- * @return {@code true} if custom setup has been performed, {@code false}
- * if not.
- */
- public boolean isConfigured() {
- return getBoolean("configured", false);
- }
-
- /**
- * Indicates whether the app is visible and navigable from Splunk Web.
- *
- * @return {@code true} if the app is visible and navigable from Splunk
- * Web, {@code false} if not.
- */
- public boolean isVisible() {
- return getBoolean("visible", false);
- }
-
- /**
- * Indicates whether a state change requires the app to be restarted.
- *
- * @return {@code true} if state changes require the app to be restarted,
- * {@code false} if not.
- */
- public boolean stateChangeRequiresRestart() {
- return getBoolean("state_change_requires_restart", false);
- }
-
- /***
- * Sets the name of the app's author. For Splunkbase apps, this value is
- * the username of the Splunk.com account. For internal apps, this value is
- * the full name.
- *
- * @param author The author name.
- */
- public void setAuthor(String author) {
- setCacheValue("author", author);
- }
-
- /**
- * Sets whether Splunk checks Splunkbase for updates to the app.
- *
- * @param value {@code true} if Splunk checks Splunkbase for app updates,
- * {@code false} if not.
- */
- public void setCheckForUpdates(boolean value) {
- setCacheValue("check_for_updates", value);
- }
-
- /**
- * Sets whether the app's custom setup has been performed. This field
- * is available in Splunk 4.2.4 and later.
- *
- * @param value {@code true} if the app has run its custom setup,
- * {@code false} if not.
- */
- public void setConfigured(boolean value) {
- setCacheValue("configured", value);
- }
-
- /**
- * Sets a short description of the application, which is displayed below
- * the app's title on the Splunk Home tab in Splunk Web.
- *
- * @param description The short description of the app.
- */
- public void setDescription(String description) {
- setCacheValue("description", description);
- }
-
- /**
- * Sets the app's name, which is displayed in Splunk Web. The name should be
- * between 5-80 characters and should not include the prefix "Splunk For".
- *
- * @param label The label (name) of the app.
- */
- public void setLabel(String label) {
- setCacheValue("label", label);
- }
-
- /**
- * Sets the version of the app.
- *
- * @param version The app's version.
- */
- public void setVersion(String version) {
- setCacheValue("version", version);
- }
-
- /**
- * Sets whether the app is visible and navigable from Splunk Web.
- *
- * @param visible {@code true} if the app can be visible and navigable
- * from Splunk Web, {@code false} if not.
- */
- public void setVisible(boolean visible) {
- setCacheValue("visible", visible);
- }
-
- /**
- * Archives the app on the server file system.
- *
- * @return The location of the archived app, as {app_name}.spl.
- */
- public ApplicationArchive archive() {
- return new ApplicationArchive(service, path);
- }
-
- /**
- * Returns the app's setup information.
- *
- * @return The app's setup information.
- */
- public ApplicationSetup setup() {
- return new ApplicationSetup(service, path);
- }
-
- /**
- * Returns any update information that is available for the app.
- *
- * @return Update information for the app.
- */
- public ApplicationUpdate getUpdate() {
- return new ApplicationUpdate(service, path);
- }
-}
-
diff --git a/splunk/src/main/java/com/splunk/ApplicationArchive.java b/splunk/src/main/java/com/splunk/ApplicationArchive.java
deleted file mode 100644
index 1ce41d98..00000000
--- a/splunk/src/main/java/com/splunk/ApplicationArchive.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-/**
- * The {@code ApplicationArchive} class represents an archive of a Splunk app.
- */
-public class ApplicationArchive extends Entity {
-
- /**
- * Class constructor.
- *
- * @param service The connected {@code Service} instance.
- * @param path The application endpoint.
- */
- ApplicationArchive(Service service, String path) {
- super(service, path + "/package");
- }
-
- /**
- * Returns the name of the app.
- *
- * @return The app's name.
- */
- public String getAppName() {
- return getString("name");
- }
-
- /**
- * Returns a path indicating where the app archive file is stored on the
- * server, for direct file access.
- *
- * @return The path to the archive file.
- */
- public String getFilePath() {
- return getString("path");
- }
-
- /**
- * Indicates whether to reload the objects contained in the
- * locally-installed app.
- *
- * @return {@code true} if objects are reloaded, {@code false} if not.
- */
- public boolean getRefresh() {
- return getBoolean("refresh", false);
- }
-
- /**
- * Returns a URL to the app archive file on the server, for web browser
- * access.
- *
- * @return The URL to the archive file.
- */
- public String getUrl() {
- return getString("url");
- }
-}
-
diff --git a/splunk/src/main/java/com/splunk/ApplicationSetup.java b/splunk/src/main/java/com/splunk/ApplicationSetup.java
deleted file mode 100644
index 1caca007..00000000
--- a/splunk/src/main/java/com/splunk/ApplicationSetup.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-/**
- * The {@code ApplicationSetup} class represents the setup information for a
- * Splunk app.
- */
-public class ApplicationSetup extends Entity {
-
- /**
- * Class constructor.
- *
- * @param service The connected {@code Service} instance.
- * @param path The application endpoint.
- */
- ApplicationSetup(Service service, String path) {
- super(service, path + "/setup");
- }
-
- /**
- * Indicates whether to reload the objects contained in the
- * locally-installed app.
- *
- * @return {@code true} if objects are reloaded, {@code false} if not.
- */
- public boolean getRefresh() {
- return getBoolean("refresh", false);
- }
-
- /**
- * Returns the app's setup information in XML format.
- *
- * @return The setup information for the app.
- */
- public String getSetupXml() {
- return getString("eai:setup");
- }
-
- // Because all other keys are dynamic and context specific, they should
- // be retrieved using Map (dictionary) get access.
-}
-
diff --git a/splunk/src/main/java/com/splunk/ApplicationUpdate.java b/splunk/src/main/java/com/splunk/ApplicationUpdate.java
deleted file mode 100644
index 66adaced..00000000
--- a/splunk/src/main/java/com/splunk/ApplicationUpdate.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-/**
- * The {@code ApplicationUpdate} class represents information for an update
- * to a locally-installed Splunk app.
- */
-public class ApplicationUpdate extends Entity {
-
- /**
- * Class constructor.
- *
- * @param service The connected {@code Service} instance.
- * @param path The application endpoint.
- */
- ApplicationUpdate(Service service, String path) {
- super(service, path + "/update");
- }
-
- /**
- * Returns the fully-qualified URL to the app update.
- *
- * @return The URL of the app update, or {@code null} if not specified.
- */
- public String getAppUrl() {
- return getString("update.appurl", null);
- }
-
- /**
- * Returns the checksum of the app.
- *
- * @return The checksum of the app, or {@code null} if not specified.
- */
- public String getChecksum() {
- return getString("update.checksum", null);
- }
-
- /**
- * Returns the checksum type of the app.
- *
- * @return The checksum type, or {@code null} if not specified.
- */
- public String getChecksumType() {
- return getString("update.checksum.type", null);
- }
-
- /**
- * Returns the fully-qualified URL to the app's homepage.
- *
- * @return The URL of the app's homepage, or {@code null} if not specified.
- */
- public String getHomepage() {
- return getString("update.homepage", null);
- }
-
- /**
- * Returns the app's name.
- *
- * @return The app's name, or {@code null} if not specified.
- */
- public String getUpdateName() {
- return getString("update.name", null);
- }
-
- /**
- * Returns the size of the app update.
- *
- * @return The size of the update, in bytes, or -1 if not specified.
- */
- public int getSize() {
- return getInteger("update.size", -1);
- }
-
- /**
- * Returns the app's version.
- *
- * @return The app's version, or {@code null} if not specified.
- */
- public String getVersion() {
- return getString("update.version", null);
- }
-
- /**
- * Indicates whether an implicit ID is required.
- *
- * @return {@code true} if an implicit ID is required, {@code false} if not.
- */
- public boolean isImplicitIdRequired() {
- return getBoolean("update.implicit_id_required", false);
- }
-}
diff --git a/splunk/src/main/java/com/splunk/Args.java b/splunk/src/main/java/com/splunk/Args.java
deleted file mode 100644
index 4e93f36a..00000000
--- a/splunk/src/main/java/com/splunk/Args.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-/**
- * The {@code Args} class is a helper class for working with Splunk REST API
- * arguments.
- *
- * This extension is used mainly for encoding arguments for UTF8 transmission
- * to a Splunk instance in a key=value pairing for a string, or
- * {@code key=value1&key=value2 } (and so on) for an array of strings.
- */
-public class Args extends LinkedHashMap {
-
- /**
- * Class constructor.
- */
- public Args() { super(); }
-
- /**
- * Class constructor. Initializes a single key-value pair.
- *
- * @param key The key name.
- * @param value The value, as a {@code String:String} or
- * {@code String:String[]}.
- */
- public Args(String key, Object value) {
- super();
- put(key, value);
- }
-
- /**
- * Class constructor. Initializes a pre-existing hash map.
- *
- * @param values A set of key-value pairs.
- */
- public Args(Map values) {
- super(values);
- }
-
- /**
- * Adds an argument to an {@code Args} object.
- *
- * @param key The key name.
- * @param value The value, as a {@code String:String} or
- * {@code String:String[]}.
- * @return This {@code Args} set.
- */
- public Args add(String key, Object value) {
- put(key, value);
- return this;
- }
-
- /**
- * Creates a new empty instance of {@code Args}.
- *
- * @return The {@code Args} instance.
- */
- public static Args create() {
- return new Args();
- }
-
- /**
- * Creates a new {@code Args} instance and initializes it with a single
- * key-value pair.
- *
- * @param key The key name.
- * @param value The value, as a {@code String:String} or
- * {@code String:String[]}.
- * @return The {@code Args} instance.
- */
- public static Args create(String key, Object value) {
- return new Args(key, value);
- }
-
- /**
- * Creates a new {@code Args} instance and initializes it with a
- * pre-existing hash map.
- *
- * @param values The pre-existing hash map.
- * @return The {@code Args} instance.
- */
- public static Args create(Map values) {
- return values == null ? new Args() : new Args(values);
- }
-
- /**
- * Encodes a single string with UTF8 encoding.
- *
- * @param value The string.
- * @return The encoded string.
- */
- public static String encode(String value) {
- if (value == null) return "";
- String result = null;
- try {
- result = URLEncoder.encode(value, "UTF-8");
- }
- catch (UnsupportedEncodingException e) { assert false; }
- return result;
- }
-
- /**
- * Encodes a hash map of {@code String:String} or {@code String:String[]}
- * into a single UTF8-encoded string.
- *
- * @param args The hash map.
- * @return The string.
- */
- public static String encode(Map args) {
- return Args.create(args).encode();
- }
-
- // Encodes an argument with a list-valued argument.
- private void
- encodeValues(StringBuilder builder, String key, String[] values) {
- key = encode(key);
- for (String value : values) {
- if (builder.length() > 0) builder.append('&');
- builder.append(key);
- builder.append('=');
- builder.append(encode(value));
- }
- }
-
- /**
- * Encodes an {@code Args} instance into a UTF8-encoded string.
- *
- * @return The UTF8-encoded string.
- */
- public String encode() {
- StringBuilder builder = new StringBuilder();
- for (Entry entry : entrySet()) {
- if (builder.length() > 0) builder.append('&');
- String key = entry.getKey();
- Object value = entry.getValue();
- if (value instanceof String[]) {
- encodeValues(builder, key, (String[])value);
- }
- else {
- builder.append(encode(key));
- builder.append('=');
- builder.append(encode(value.toString()));
- }
- }
- return builder.toString();
- }
-
- /**
- * Returns the hash-map value of a specific key, or the default value if
- * the key is not found.
- *
- * @param args The hash map.
- * @param key The key to look for.
- * @param defaultValue The default value, if the key is not found.
- * @param The class type.
- * @return The value.
- */
- public static T
- get(Map args, String key, T defaultValue) {
- if (!args.containsKey(key)) return defaultValue;
- return (T)args.get(key);
- }
-}
-
diff --git a/splunk/src/main/java/com/splunk/AtomEntry.java b/splunk/src/main/java/com/splunk/AtomEntry.java
deleted file mode 100644
index 1282d2d2..00000000
--- a/splunk/src/main/java/com/splunk/AtomEntry.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-/**
- * The {@code AtomEntry} class represents an Atom {@code } element.
- */
-public class AtomEntry extends AtomObject {
- /** The value of the Atom entry's {@code } element. */
- public String published;
-
- /** The value of the Atom entry's {@code } element. */
- public Record content;
-
- /**
- * Creates a new {@code AtomEntry} instance.
- *
- * @return A new {@code AtomEntry} instance.
- */
- static AtomEntry create() {
- return new AtomEntry();
- }
-
- /**
- * Creates a new {@code AtomEntry} instance based on a given stream.
- * A few endpoints, such as {@code search/jobs/{sid}},
- * return an Atom {@code } element as the root of the response.
- *
- * @param input The input stream.
- * @return An {@code AtomEntry} instance representing the parsed stream.
- */
-
- public static AtomEntry parseStream(InputStream input) {
- XMLStreamReader reader = createReader(input);
-
- AtomEntry result = AtomEntry.parse(reader);
-
- try {
- reader.close();
- }
- catch (XMLStreamException e) {
- throw new RuntimeException(e.getMessage(), e);
- }
-
- return result;
- }
-
- /**
- * Creates a new {@code AtomEntry} instance based on a given XML reader.
- *
- * @param reader The XML reader.
- * @return An {@code AtomEntry} instance representing the parsed XML.
- */
- static AtomEntry parse(XMLStreamReader reader) {
- AtomEntry entry = AtomEntry.create();
- entry.load(reader, "entry");
- return entry;
- }
-
- /**
- * Initializes the current instance using the given XML reader.
- *
- * @param reader The XML reader.
- */
- @Override void init(XMLStreamReader reader) {
- assert reader.isStartElement();
-
- String name = reader.getLocalName();
-
- if (name.equals("published")) {
- this.published = parseText(reader);
- }
- else if (name.equals("content")) {
- this.content = parseContent(reader);
- }
- else {
- super.init(reader);
- }
- }
-
- /**
- * Parses the {@code } element of an Atom entry.
- *
- * @param reader The XML reader.
- * @return A {@code Record} object containing the parsed values.
- */
- private Record parseContent(XMLStreamReader reader) {
- assert isStartElement(reader, "content");
-
- scan(reader);
-
- // The content element should contain a single element
-
- if (!isStartElement(reader, "dict"))
- syntaxError(reader);
-
- content = parseDict(reader);
-
- if (!isEndElement(reader, "content"))
- syntaxError(reader);
-
- scan(reader); // Consume
-
- return content;
- }
-
- /**
- * Parses a {@code } content element and returns a {@code Record}
- * object containing the parsed values.
- *
- * @param reader The {@code } element to parse.
- * @return A {@code Record} object containing the parsed values.
- */
- private Record parseDict(XMLStreamReader reader) {
- assert isStartElement(reader, "dict");
-
- Record result = new Record();
-
- scan(reader);
- while (isStartElement(reader, "key")) {
- String key = reader.getAttributeValue(null, "name");
- Object value = parseValue(reader);
- // Null values, the result of empty elements, are parsed as though
- // they don't exist, making it easier for the client framework to
- // supply more meaningful default values.
- if (value != null) result.put(key, value);
- }
-
- if (!isEndElement(reader, "dict"))
- syntaxError(reader);
-
- scan(reader); // Consume
-
- return result;
- }
-
- /**
- * Parses a {@code } element and returns a {@code List} object
- * containing the parsed values.
- *
- * @param reader The XML reader.
- * @return A {@code List} object containing the parsed values.
- */
- private List parseList(XMLStreamReader reader) {
- assert isStartElement(reader, "list");
-
- List result = new ArrayList();
-
- scan(reader);
- while (isStartElement(reader, "item")) {
- Object value = parseValue(reader);
- result.add(value);
- }
-
- if (!isEndElement(reader, "list"))
- syntaxError(reader);
-
- scan(reader); // Consume
-
- return result;
- }
-
- // Parses either a dict or list structure.
- private Object parseStructure(XMLStreamReader reader) {
- String name = reader.getLocalName();
-
- if (name.equals("dict"))
- return parseDict(reader);
-
- if (name.equals("list"))
- return parseList(reader);
-
- syntaxError(reader);
-
- return null; // Unreached
- }
-
- /**
- * Parses the value contained by the element at the current cursor position
- * of the given reader.
- *
- * Note: This function takes the parent element as its starting point
- * so that it can correctly match the end element. The function takes the
- * start element and its corresponding end element, then returns the
- * contained value. The cursor is then located at the next element to be
- * parsed.
- *
- * @param reader The XML reader to parse.
- * @return An object containing the parsed values. If the source was a text
- * value, the object is a {@code String}. If the source was a {@code }
- * element, the object is a {@code Record}. If the source was a
- * {@code } element, the object is a {@code List} object.
- */
- Object parseValue(XMLStreamReader reader) {
- assert reader.isStartElement();
-
- String name = reader.getLocalName();
-
- scan(reader);
-
- Object value;
- switch (reader.getEventType()) {
- case XMLStreamConstants.CHARACTERS:
- value = reader.getText();
- scan(reader); // Advance cursor
- break;
-
- case XMLStreamConstants.START_ELEMENT:
- value = parseStructure(reader);
- break;
-
- case XMLStreamConstants.END_ELEMENT:
- value = null; // Empty element
- break;
-
- default:
- value = null;
- syntaxError(reader);
- }
-
- if (!isEndElement(reader, name))
- syntaxError(reader);
-
- scan(reader); // Consume end element
-
- return value;
- }
-}
diff --git a/splunk/src/main/java/com/splunk/AtomFeed.java b/splunk/src/main/java/com/splunk/AtomFeed.java
deleted file mode 100644
index 27915701..00000000
--- a/splunk/src/main/java/com/splunk/AtomFeed.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-import java.io.InputStream;
-import java.util.*;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamConstants;
-
-/**
- * The {@code AtomFeed} class represents an Atom feed.
- */
-public class AtomFeed extends AtomObject {
- /** The list of Atom entries contained in this {@code AtomFeed} object. */
- public ArrayList entries = new ArrayList();
-
- /** The value of the Atom feed's {@code } element. */
- public String itemsPerPage = null;
-
- /** The value of the Atom feed's {@code } element. */
- public String startIndex = null;
-
- /** The value of the Atom feed's {@code } element. */
- public String totalResults = null;
-
- /**
- * Creates a new {@code AtomFeed} instance.
- *
- * @return A new {@code AtomFeed} instance.
- */
- static AtomFeed create() {
- return new AtomFeed();
- }
-
- /**
- * Creates a new {@code AtomFeed} instance based on the given stream.
- *
- * @param input The input stream.
- * @return An {@code AtomFeed} instance representing the parsed stream.
- */
- public static AtomFeed parseStream(InputStream input) {
- XMLStreamReader reader = createReader(input);
-
- AtomFeed result = AtomFeed.parse(reader);
-
- try {
- reader.close();
- }
- catch (XMLStreamException e) {
- throw new RuntimeException(e.getMessage(), e);
- }
-
- return result;
- }
-
- /**
- * Creates a new {@code AtomFeed} instance based on a given XML element.
- *
- * @param input The XML stream.
- * @return An {@code AtomFeed} instance representing the parsed element.
- * @throws RuntimeException The runtime exception if a parse error occurs.
- */
- static AtomFeed parse(XMLStreamReader input) {
- AtomFeed feed = AtomFeed.create();
- feed.load(input, "feed");
- return feed;
- }
-
- /**
- * Initializes the current instance from a given XML element.
- *
- * @param reader The XML reader.
- */
- @Override void init(XMLStreamReader reader) {
- assert reader.isStartElement();
-
- String name = reader.getLocalName();
-
- if (name.equals("entry")) {
- AtomEntry entry = AtomEntry.parse(reader);
- this.entries.add(entry);
- }
- else if (name.equals("messages")) {
- parseEnd(reader);
- }
- else if (name.equals("totalResults")) {
- this.totalResults = parseText(reader);
- }
- else if (name.equals("itemsPerPage")) {
- this.itemsPerPage = parseText(reader);
- }
- else if (name.equals("startIndex")) {
- this.startIndex = parseText(reader);
- }
- else {
- super.init(reader);
- }
- }
-}
-
diff --git a/splunk/src/main/java/com/splunk/AtomObject.java b/splunk/src/main/java/com/splunk/AtomObject.java
deleted file mode 100644
index 67567134..00000000
--- a/splunk/src/main/java/com/splunk/AtomObject.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamConstants;
-
-/**
- * The {@code AtomObject} class represents a generic Atom object. This class is
- * a common base class shared by {@code AtomFeed} and {@code AtomEntry}.
- */
-public class AtomObject {
- /** The value of the Atom {@code } element. */
- public String id;
-
- /** The value of the {@code } elements in this {@code AtomObject}. */
- public Map links = new HashMap();
-
- /** The value of the Atom {@code } element. */
- public String title;
-
- /** The value of the Atom {@code } element. */
- public String updated;
-
- /**
- * Instantiates the XMLStreamReader, advances to the root element and
- * validates the root document structure. This initialization code is shared
- * by the {@code AtomFeed} and {@code AtomEntry} parsers.
- *
- * @param input The input stream.
- * @return An {@code XMLStreamReader} initialized reader, advanced to the
- * first element of the document.
- */
- protected static XMLStreamReader createReader(InputStream input) {
- XMLInputFactory factory = XMLInputFactory.newInstance();
-
- // The Atom parser assumes that all adjacent text nodes are coalesced
- factory.setProperty(XMLInputFactory.IS_COALESCING, true);
- factory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, true);
-
- XMLStreamReader reader;
- try {
- reader = factory.createXMLStreamReader(input);
- }
- catch (XMLStreamException e) {
- throw new RuntimeException(e.getMessage(), e);
- }
-
- assert reader.getEventType() == XMLStreamConstants.START_DOCUMENT;
-
- // Scan ahead to first element
- scanTag(reader);
-
- return reader;
- }
-
- /**
- * Initialize a property of the current instance based on the given XML
- * element.
- *
- * @param reader The XML reader.
- */
- void init(XMLStreamReader reader) {
- assert reader.isStartElement();
-
- String name = reader.getLocalName();
-
- if (name.equals("id")) {
- this.id = parseText(reader);
- }
- else if (name.equals("link")) {
- String rel = reader.getAttributeValue(null, "rel");
- String href = reader.getAttributeValue(null, "href");
- this.links.put(rel, href);
- parseEnd(reader);
- }
- else if (name.equals("title")) {
- this.title = parseText(reader);
- }
- else if (name.equals("updated")) {
- this.updated = parseText(reader);
- }
- else {
- parseEnd(reader); // Ignore
- }
- }
-
- /**
- * Initializes the current instance from the given XML element by calling
- * the {@code init} method on each child of the XML element.
- *
- * @param reader The XML reader.
- */
- void load(XMLStreamReader reader, String localName) {
- assert isStartElement(reader, localName);
-
- String name = reader.getLocalName();
-
- scan(reader);
- while (reader.isStartElement()) {
- init(reader);
- }
-
- if (!isEndElement(reader, name))
- syntaxError(reader);
-
- scan(reader); // Consume the end element
- }
-
- /**
- * Parses the element at the current cursor position and reads the
- * corresponding end element.
- *
- * @param reader The XML reader.
- */
- protected void parseEnd(XMLStreamReader reader) {
- scanEnd(reader); // Scan ahead to the end element
- scan(reader); // Consume the end element
- }
-
- /**
- * Parses and returns the text value of the element at the current cursor
- * position and reads the corresponding end element.
- *
- * @param reader The XML reader.
- * @return The element's text value.
- */
- protected String parseText(XMLStreamReader reader) {
- assert reader.isStartElement();
-
- String name = reader.getLocalName();
-
- String value = getElementText(reader);
-
- if (!isEndElement(reader, name))
- syntaxError(reader);
-
- scan(reader); // Consume the end element
-
- return value;
- }
-
- //
- // Lexical helpers
- //
-
- protected static String getElementText(XMLStreamReader reader) {
- try {
- return reader.getElementText();
- }
- catch (XMLStreamException e) {
- throw new RuntimeException(e.getMessage(), e);
- }
- }
-
- protected static boolean
- isEndElement(XMLStreamReader reader, String localName) {
- return reader.isEndElement()
- && reader.getLocalName().equals(localName);
- }
-
- protected static boolean
- isStartElement(XMLStreamReader reader, String localName) {
- return reader.isStartElement()
- && reader.getLocalName().equals(localName);
- }
-
- // Scan ahead to the next token, skipping whitespace
- protected static void scan(XMLStreamReader reader) {
- assert !reader.isWhiteSpace(); // current should never be white
- try {
- do {
- reader.next();
- }
- while (reader.isWhiteSpace()); // Ignore whitespace
- }
- catch (XMLStreamException e) {
- throw new RuntimeException(e.getMessage(), e);
- }
- }
-
- // Scan ahead to the end element that matches the current start element.
- // Note: function returns cursor located at matching end element.
- protected static void scanEnd(XMLStreamReader reader) {
- assert reader.isStartElement();
-
- String name = reader.getLocalName();
-
- while (true) {
- scan(reader);
-
- switch (reader.getEventType()) {
- case XMLStreamConstants.CHARACTERS:
- continue;
-
- case XMLStreamConstants.START_ELEMENT:
- scanEnd(reader);
- continue;
-
- case XMLStreamConstants.END_ELEMENT:
- if (!reader.getLocalName().equals(name))
- syntaxError(reader);
- return;
-
- default:
- syntaxError(reader);
- }
- }
- }
-
- // Scan ahead until the next start tag.
- protected static void scanTag(XMLStreamReader reader) {
- try {
- reader.nextTag();
- }
- catch (XMLStreamException e) {
- throw new RuntimeException(e.getMessage(), e);
- }
- }
-
- // Raises a Syntax error runtime exception
- protected static void syntaxError(XMLStreamReader reader) {
- Location location = reader.getLocation();
- String where = location.toString();
- String message = String.format("Syntax error @ %s", where);
- throw new RuntimeException(message);
- }
-}
diff --git a/splunk/src/main/java/com/splunk/BaseService.java b/splunk/src/main/java/com/splunk/BaseService.java
deleted file mode 100644
index d311b13e..00000000
--- a/splunk/src/main/java/com/splunk/BaseService.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-/**
- * Contains functionality common to Splunk Enterprise and Splunk Storm.
- *
- * This class is an implementation detail and is therefore SDK-private.
- */
-abstract class BaseService extends HttpService {
- protected BaseService() {
- super();
- }
-
- protected BaseService(String host) {
- super(host);
- }
-
- protected BaseService(String host, int port) {
- super(host, port);
- }
-
- protected BaseService(String host, int port, String scheme) {
- super(host, port, scheme);
- }
-}
diff --git a/splunk/src/main/java/com/splunk/BooleanComparison.java b/splunk/src/main/java/com/splunk/BooleanComparison.java
deleted file mode 100644
index 8751db96..00000000
--- a/splunk/src/main/java/com/splunk/BooleanComparison.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package com.splunk;
-
-/**
- * Comparisons on boolean valued fields.
- */
-public enum BooleanComparison {
- IS_NULL {
- public String toString() { return "isNull"; }
- },
- IS_NOT_NULL {
- public String toString() { return "isNotNull"; }
- },
- EQUALS {
- public String toString() { return "="; }
- },
- IS {
- public String toString() { return "is"; }
- }
-}
diff --git a/splunk/src/main/java/com/splunk/BooleanPivotColumnSplit.java b/splunk/src/main/java/com/splunk/BooleanPivotColumnSplit.java
deleted file mode 100644
index 66b096dd..00000000
--- a/splunk/src/main/java/com/splunk/BooleanPivotColumnSplit.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package com.splunk;
-
-import com.google.gson.JsonObject;
-
-/**
- * Represents a column split on a boolean valued field in a pivot.
- */
-public class BooleanPivotColumnSplit extends PivotColumnSplit {
- private final String trueLabel, falseLabel;
-
- BooleanPivotColumnSplit(DataModelObject owner, String fieldName, String trueLabel, String falseLabel) {
- super(owner, fieldName);
- this.trueLabel = trueLabel;
- this.falseLabel = falseLabel;
- }
-
- @Override
- JsonObject toJson() {
- JsonObject root = new JsonObject();
- addCommonFields(root);
-
- root.addProperty("trueLabel", trueLabel);
- root.addProperty("falseLabel", falseLabel);
-
- return root;
- }
-}
diff --git a/splunk/src/main/java/com/splunk/BooleanPivotFilter.java b/splunk/src/main/java/com/splunk/BooleanPivotFilter.java
deleted file mode 100644
index 3e08d6c0..00000000
--- a/splunk/src/main/java/com/splunk/BooleanPivotFilter.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package com.splunk;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonPrimitive;
-
-/**
- * Represents a filter on a boolean valued field in a pivot.
- */
-public class BooleanPivotFilter extends PivotFilter {
- private final BooleanComparison comparison;
- private final boolean comparisonValue;
-
- BooleanPivotFilter(DataModelObject dataModelObject, String fieldName,
- BooleanComparison comparison, boolean comparisonValue) {
- super(dataModelObject, fieldName);
- if (dataModelObject.getField(fieldName).getType() != FieldType.BOOLEAN) {
- throw new IllegalArgumentException("Field " + fieldName + " on the data model object was of type "
- + dataModelObject.getField(fieldName).getType().toString() + ", expected boolean.");
- }
- this.comparison = comparison;
- this.comparisonValue = comparisonValue;
- }
-
- @Override
- JsonElement toJson() {
- JsonObject root = new JsonObject();
-
- addCommonFields(root);
-
- JsonObject filterRule = new JsonObject();
- filterRule.add("comparator", new JsonPrimitive(this.comparison.toString()));
- filterRule.add("compareTo", new JsonPrimitive(this.comparisonValue));
-
- root.add("rule", filterRule);
-
- return root;
- }
-}
diff --git a/splunk/src/main/java/com/splunk/BooleanPivotRowSplit.java b/splunk/src/main/java/com/splunk/BooleanPivotRowSplit.java
deleted file mode 100644
index d68df895..00000000
--- a/splunk/src/main/java/com/splunk/BooleanPivotRowSplit.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package com.splunk;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonPrimitive;
-
-/**
- * Represents a row split on a boolean valued field in a pivot.
- */
-public class BooleanPivotRowSplit extends PivotRowSplit {
- private final String falseDisplayValue;
- private final String trueDisplayValue;
-
- BooleanPivotRowSplit(DataModelObject dataModelObject, String field, String label,
- String trueDisplayValue, String falseDisplayValue) {
- super(dataModelObject, field, label);
- this.trueDisplayValue = trueDisplayValue;
- this.falseDisplayValue = falseDisplayValue;
- }
-
- public String getTrueDisplayValue() { return this.trueDisplayValue; }
- public String getFalseDisplayValue() { return this.falseDisplayValue; }
-
- @Override
- JsonElement toJson() {
- JsonObject root = new JsonObject();
-
- addCommonFields(root);
-
- root.add("trueLabel", new JsonPrimitive(this.trueDisplayValue));
- root.add("falseLabel", new JsonPrimitive(this.falseDisplayValue));
-
- return root;
- }
-}
diff --git a/splunk/src/main/java/com/splunk/CollectionArgs.java b/splunk/src/main/java/com/splunk/CollectionArgs.java
deleted file mode 100644
index 25fd35aa..00000000
--- a/splunk/src/main/java/com/splunk/CollectionArgs.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-/**
- * The {@code CollectionArgs} class contains arguments for retrieving and
- * listing entities from a collection, such as the number of entities to return
- * and how to sort them.
- */
-public class CollectionArgs extends Args {
-
- /**
- * Indicates whether to sort entries in ascending or descending order.
- */
- public static enum SortDirection {
- /** Sort entries in ascending order. */
- ASC("asc"),
- /** Sort entries in descending order. */
- DESC("desc");
-
- private String value;
-
- private SortDirection(String value) {
- this.value = value;
- }
-
- /**
- * @return The REST API value for this enumerated constant.
- */
- public String toString() {
- return this.value;
- }
- }
-
- /**
- * Indicates the sorting mode for entries.
- */
- public static enum SortMode {
- /**
- * If all values of the field are numbers, collate numerically.
- * Otherwise, collate alphabetically.
- */
- AUTO("auto"),
- /** Collate alphabetically. */
- ALPHA("alpha"),
- /** Collate alphabetically, case-sensitive. */
- ALPHA_CASE("alpha_case"),
- /** Collate numerically. */
- NUM("num");
-
- private String value;
-
- private SortMode(String value) {
- this.value = value;
- }
-
- /**
- * @return The REST API value for this enumerated constant.
- */
- public String toString() {
- return this.value;
- }
- }
-
- /**
- * Class constructor.
- */
- public CollectionArgs() { super(); }
-
- /* BEGIN AUTOGENERATED CODE */
-
- /**
- * Sets the app context in which to list the collection.
- *
- * @param app
- * The app context in which to list the collection. A {@code null} value indicates no app context, and a value of {@code "-"} indicates an app wildcard.
- */
- public void setApp(String app) {
- this.put("app", app);
- }
-
- /**
- * Sets the owner context in which to list the collection.
- *
- * @param owner
- * The owner context in which to list the collection. A value of {@code "-"} indicates a wildcard, and a {@code null} value indicates no owner context.
- */
- public void setOwner(String owner) {
- this.put("owner", owner);
- }
-
- /**
- * Sets the sharing context in which to list the collection.
- *
- * @param sharing
- * The sharing context in which to list the collection. Valid values are "user", "app", "global", and "system".
- */
- public void setSharing(String sharing) {
- this.put("sharing", sharing);
- }
-
- /**
- * Sets the maximum number of entries to return.
- *
- * @param count
- * The maximum number of entries to return. To return all entries, specify 0.
- */
- public void setCount(int count) {
- this.put("count", count);
- }
-
- /**
- * Sets the index of the first entry to return.
- *
- * @param offset
- * The index of the first entry to return.
- */
- public void setOffset(int offset) {
- this.put("offset", offset);
- }
-
- /**
- * Sets a search query to filter the response. The response matches field values against the search query. For example, "foo" matches any object that has "foo" as a substring in a field, and "field_name=field_value" restricts the match to a single field.
- *
- * @param search
- * A search query to filter the response.
- */
- public void setSearch(String search) {
- this.put("search", search);
- }
-
- /**
- * Sets the direction to sort entries.
- *
- * @param sortDirection
- * The sorting order--ascending or descending.
- */
- public void setSortDirection(SortDirection sortDirection) {
- this.put("sort_dir", sortDirection);
- }
-
- /**
- * Sets the field to use for sorting.
- *
- * @param sortKey
- * The field to sort by.
- */
- public void setSortKey(String sortKey) {
- this.put("sort_key", sortKey);
- }
-
- /**
- * Sets the mode to use for sorting.
- *
- * @param sortMode
- * The collating sequence for sorting entries.
- */
- public void setSortMode(SortMode sortMode) {
- this.put("sort_mode", sortMode);
- }
-
- /* END AUTOGENERATED CODE */
-}
diff --git a/splunk/src/main/java/com/splunk/Command.java b/splunk/src/main/java/com/splunk/Command.java
deleted file mode 100644
index 4dbd39b6..00000000
--- a/splunk/src/main/java/com/splunk/Command.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Copyright 2011 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.commons.cli.PosixParser;
-
-/**
- * This class serves as an example and is unsupported.
- *
- * Processes and capture command options and arguments
- */
-public class Command {
- private String appName;
- private Options rules = new Options();
-
- // The parsed command line arguments
- public String[] args = new String[0];
-
- // The parsed command line options (flags)
- public HashMap opts = new HashMap();
-
- // Whether or not this is a help request
- public Boolean help = false;
-
- public static final HashMap defaultValues = new HashMap();
- {
- defaultValues.put("scheme", "https");
- defaultValues.put("host", "localhost");
- defaultValues.put("port", 8089);
- }
-
- Command(String appName) {
- this.appName = appName;
- }
-
- public static Command create() {
- return create(null);
- }
-
- public static Command create(String appName) {
- return new Command(appName);
- }
-
- public static void error(String message, Object... args) {
- System.err.format("Error: %s\n", String.format(message, args));
- System.exit(2);
- }
-
- public Options getRules() {
- return this.rules;
- }
-
- // Initialize with default Splunk command options.
- @SuppressWarnings("static-access") // OptionBuilder API requires this
- public Command init() {
- rules.addOption("h", "help", false, "Display this help message");
- rules.addOption(null, "host", true, "Host name (default localhost)");
- rules.addOption(OptionBuilder
- .withLongOpt("port")
- .hasArg(true)
- .withType(Integer.class)
- .create());
- rules.addOption(null, "scheme", true, "Scheme (default https)");
- rules.addOption(null, "username", true, "Username to login with");
- rules.addOption(null, "password", true, "Password to login with");
- rules.addOption(null, "app", true, "App/namespace context");
- rules.addOption(null, "owner", true, "Owner/user context");
- // This is here only for compatibility with the JavaScript SDK's .splunkrc.
- rules.addOption(null, "version", true, "Version (irrelevant for Java)");
- return this;
- }
-
- public Command addRule(String name, String description) {
- rules.addOption(null, name, false, description);
- return this;
- }
-
- @SuppressWarnings("static-access") // OptionBuilder API requires this
- public Command addRule(String name, Class argType, String description) {
- rules.addOption(
- OptionBuilder
- .withLongOpt(name)
- .hasArg(true)
- .withType(argType)
- .withDescription(description)
- .create());
- return this;
- }
-
- // Load a file of options and arguments
- public Command load(String path) {
- ArrayList argList = new ArrayList();
-
- try {
- FileReader fileReader = new FileReader(path);
- try {
- BufferedReader reader = new BufferedReader(fileReader);
- while (true) {
- String line;
- line = reader.readLine();
- if (line == null)
- break;
- if (line.startsWith("#"))
- continue;
- line = line.trim();
- if (line.length() == 0)
- continue;
- if (!line.startsWith("-"))
- line = "--" + line;
- argList.add(line);
- }
- }
- finally {
- fileReader.close();
- }
- }
- catch (IOException e) {
- error(e.getMessage());
- return this;
- }
-
- parse(argList.toArray(new String[argList.size()]));
- return this;
- }
-
- // Parse the given argument vector
- public Command parse(String[] argv) {
- CommandLineParser parser = new PosixParser();
-
- CommandLine cmdline = null;
- try {
- cmdline = parser.parse(this.rules, argv);
- }
- catch (ParseException e) {
- error(e.getMessage());
- }
-
- // Unpack the cmdline into a simple Map of options and optionally
- // assign values to any corresponding fields found in the Command class.
- for (Option option : cmdline.getOptions()) {
- String name = option.getLongOpt();
- Object value = option.getValue();
-
- // Figure out the type of the option and convert the value.
- if (!option.hasArg()) {
- // If it has no arg, then its implicitly boolean and presence
- // of the argument indicates truth.
- value = true;
- }
- else {
- Class type = (Class)option.getType();
- if (type == null) {
- // Null implies String, no conversion necessary
- }
- else if (type == Integer.class) {
- value = Integer.parseInt((String)value);
- }
- else {
- assert false; // Unsupported type
- }
- }
-
- this.opts.put(name, value);
-
- // Look for a field of the Command class (or subclass) that
- // matches the long name of the option and, if found, assign the
- // corresponding option value in order to provide simplified
- // access to command options.
- try {
- java.lang.reflect.Field field = this.getClass().getField(name);
- field.set(this, value);
- }
- catch (NoSuchFieldException e) { continue; }
- catch (IllegalAccessException e) {
- throw new RuntimeException(e.getMessage(), e);
- }
- }
-
- String[] orig = this.args;
- String[] more = cmdline.getArgs();
- this.args = new String[orig.length + more.length];
- System.arraycopy(orig, 0, this.args, 0, orig.length);
- System.arraycopy(more, 0, this.args, orig.length, more.length);
-
- if (this.help) {
- printHelp();
- System.exit(0);
- }
-
- return this;
- }
-
- public void printHelp() {
- HelpFormatter formatter = new HelpFormatter();
- String appName = this.appName == null ? "App" : this.appName;
- formatter.printHelp(appName, this.rules);
- }
-
- public static Command splunk() {
- return splunk(null);
- }
-
- // Creates a command instance, initializes with the default Splunk
- // command line rules and attempts to load the default options file.
- public static Command splunk(String appName) {
- return Command.create(appName).init().splunkrc();
- }
-
- // Load the default options file (.splunkrc) if it exists
- public Command splunkrc() {
- this.opts.putAll(defaultValues);
- load(System.getProperty("user.home") + File.separator + ".splunkrc");
- return this;
- }
-}
-
diff --git a/splunk/src/main/java/com/splunk/ConfCollection.java b/splunk/src/main/java/com/splunk/ConfCollection.java
deleted file mode 100644
index cc2cbf8d..00000000
--- a/splunk/src/main/java/com/splunk/ConfCollection.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-import java.util.Map;
-
-/**
- * The {@code ConfCollection} class represents a collection of configuration
- * files.
- */
-public class ConfCollection
- extends ResourceCollection>
-{
- /**
- * Class constructor.
- *
- * @param service The connected {@code Service} instance.
- */
- ConfCollection(Service service) {
- super(service, "properties", EntityCollection.class);
- }
-
- /**
- * Class constructor.
- *
- * @param service The connected {@code Service} instance.
- * @param args Collection arguments that specify the number of entities to
- * return and how to sort them. See {@link CollectionArgs}.
- */
- ConfCollection(Service service, Args args) {
- super(service, "properties", EntityCollection.class, args);
- }
-
- /**
- * Creates a new stanza in the current configuration file.
- *
- * @param name The name of the stanza to create.
- * @return The name of the new stanza.
- */
- public EntityCollection create(String name) {
- return create(name, null);
- }
-
- /**
- * Creates a new stanza in the current configuration file with attributes.
- *
- * @param name The name of the stanza to create.
- * @param args Optional. A set of attributes as key-value pairs to put in
- * the new stanza.
- * @return The name of the new stanza.
- */
- public EntityCollection create(String name, Map args) {
- args = Args.create(args).add("__conf", name);
- service.post(path, args);
- invalidate();
- return get(name);
- }
-
- /**
- * Returns the endpoint path for this configuration stanza.
- *
- * @param entry The {@code AtomEntry} representation of this entry.
- * @return This stanza's endpoint path in the format
- * "/servicesNS/{user}/{app}/configs/conf-{file}/{stanza}".
- */
- @Override protected String itemPath(AtomEntry entry) {
- return String.format("configs/conf-%s", entry.title);
- }
-}
diff --git a/splunk/src/main/java/com/splunk/DataModel.java b/splunk/src/main/java/com/splunk/DataModel.java
deleted file mode 100644
index ce42f6f9..00000000
--- a/splunk/src/main/java/com/splunk/DataModel.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-import com.google.gson.*;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * DataModel represents a data model on the server. Data models contain
- * data model objects, which specify structured views on Splunk data.
- */
-public class DataModel extends Entity {
- private final static JsonParser jsonParser = new JsonParser();
- private final static Gson gson = new Gson();
-
- private static final String ACCELERATION_LABEL = "acceleration";
- private static final String MODEL_NAME_LABEL = "modelName";
- private static final String DISPLAY_NAME_LABEL = "displayName";
- private static final String DESCRIPTION_LABEL = "description";
- private static final String RAW_JSON_LABEL = "description"; // Yes, this is insane.
-
- // Human readable description, as opposed to the raw JSON, which is also called 'description'
- private String description;
-
- private Map objects;
- private boolean accelerationEnabled;
- private String earliestAcceleratedTime;
- private String accelerationCronSchedule;
- private boolean manualRebuilds;
-
- DataModel(Service service, String path) {
- super(service, path);
- // The data provided by the collection is incomplete. Go ahead and refresh so we don't
- // have to worry about it.
- this.refresh();
- }
-
- /**
- * Returns whether there is an object of the given name in this data model.
- *
- * @param name Name of the object to check for.
- * @return true if there is an object with that name; false otherwise.
- */
- public boolean containsObject(String name) {
- return this.objects.containsKey(name);
- }
-
- /**
- * Retrieve an object by name from this data model.
- *
- * @param name Name of the object to retrieve.
- * @return a DataModelObject if there is such an object; null otherwise.
- */
- public DataModelObject getObject(String name) {
- return this.objects.get(name);
- }
-
- /**
- * @return a collection of all objects in this data model.
- */
- public Collection getObjects() {
- return Collections.unmodifiableCollection(objects.values());
- }
-
- /**
- * Returns the tsidx namespace which holds global acceleration events for this
- * data model. The namespace will be returned whether acceleration is enabled
- * or not.
- *
- * @return The tsidx namespace for global acceleration of this data model.
- */
- public String getAccelerationNamespace() {
- // For the moment, the acceleration namespace for global acceleration of
- // data models is the name of the data model.
- return getName();
- }
-
- /**
- * @return whether global acceleration is enabled for this data model.
- */
- public boolean isAccelerated() {
- return this.accelerationEnabled;
- }
-
- /**
- * @return A human readable description of this data model.
- */
- public String getDescription() {
- return this.description;
- }
-
- /**
- * @return The raw JSON describing this data model and its objects.
- */
- public String getRawJson() {
- return getString(RAW_JSON_LABEL);
- }
-
- /**
- * @return the human readable name of this data model.
- */
- public String getDisplayName() {
- return getString(DISPLAY_NAME_LABEL);
- }
-
- @Override
- Entity load(AtomObject value) {
- Entity result = super.load(value);
- // After loading the Atom entity as we would for any other Splunk entity,
- // we have to parse the JSON description of the data model and its acceleration
- // status.
- parseDescription(getString(RAW_JSON_LABEL));
- parseAcceleration(getString(ACCELERATION_LABEL));
- return result;
- }
-
- /**
- * Parse the JSON returned from splunkd describing this data model.
- *
- * This method writes the results into fields of this object.
- *
- * @param input a String containing JSON.
- */
- private void parseDescription(String input) {
- objects = new HashMap();
-
- JsonElement rootElement = jsonParser.parse(input);
-
- for (Entry entry : rootElement.getAsJsonObject().entrySet()) {
- if (entry.getKey().equals(MODEL_NAME_LABEL)) {
- content.put(MODEL_NAME_LABEL, entry.getValue().getAsString());
- } else if (entry.getKey().equals(DISPLAY_NAME_LABEL)) {
- content.put(DISPLAY_NAME_LABEL, entry.getValue().getAsString());
- } else if (entry.getKey().equals(DESCRIPTION_LABEL)) {
- description = entry.getValue().getAsString();
- } else if (entry.getKey().equals("objects")) {
- JsonArray objectArray = entry.getValue().getAsJsonArray();
- for (JsonElement object : objectArray) {
- DataModelObject dmo = DataModelObject.parse(this, object);
- objects.put(dmo.getName(), dmo);
- }
- } else {
- // Allow new keys without complaining
- }
- }
- }
-
- /**
- * Parse the acceleration description from splunkd of this data model.
- *
- * This method writes the results into fields of this object.
- *
- * @param input a string containing JSON.
- */
- private void parseAcceleration(String input) {
- JsonElement rootElement = jsonParser.parse(input);
-
- for (Entry entry : rootElement. getAsJsonObject().entrySet()) {
- if (entry.getKey().equals("enabled")) {
- // API is broken in 6.1. It returns 1 instead of true (but does return false).
- if (((JsonPrimitive)entry.getValue()).isBoolean()) {
- accelerationEnabled = entry.getValue().getAsBoolean();
- } else if (((JsonPrimitive)entry.getValue()).isNumber()) {
- accelerationEnabled = entry.getValue().getAsInt() != 0;
- } else {
- throw new RuntimeException("splunkd returned an unknown value " + entry.getValue().toString() +
- " for whether acceleration is enabled.");
- }
- } else if (entry.getKey().equals("earliest_time")) {
- earliestAcceleratedTime = entry.getValue().getAsString();
- } else if (entry.getKey().equals("cron_schedule")) {
- accelerationCronSchedule = entry.getValue().getAsString();
- } else if (entry.getKey().equals("manual_rebuilds")) {
- if (((JsonPrimitive)entry.getValue()).isBoolean()) {
- manualRebuilds = entry.getValue().getAsBoolean();
- } else if (((JsonPrimitive)entry.getValue()).isNumber()) {
- manualRebuilds = entry.getValue().getAsInt() != 0;
- } else {
- throw new RuntimeException("splunkd returned an unknown value " + entry.getValue().toString() +
- " for whether manual_rebuilds is enabled.");
- }
- } else {
- // Allow new keys without complaining
- }
- }
- }
-
- /**
- * Enable or disable global acceleration on this data model.
- *
- * @param enabled true enabled, false disables.
- */
- public void setAcceleration(boolean enabled) {
- this.accelerationEnabled = enabled;
- toUpdate.put("enabled", enabled);
- }
-
- /**
- * Return the earliest time of the window over which the data model is accelerated.
- *
- * Times are represented relative to now, given by a minus sign, a number, and a
- * suffix indicating the time unit (e.g., "-2mon", "-1day").
- *
- * @return a string representing the earliest accelerated time.
- */
- public String getEarliestAcceleratedTime() {
- return earliestAcceleratedTime;
- }
-
- /**
- * Set the size of the window (from the specified earliest time to now) over
- * which the data model should be accelerated.
- *
- * Times are represented relative to now, given by a minus sign, a number, and a
- * suffix indicating the time unit (e.g., "-2mon", "-1day").
- *
- * @param earliestAcceleratedTime a string specifying a time.
- */
- public void setEarliestAcceleratedTime(String earliestAcceleratedTime) {
- this.earliestAcceleratedTime = earliestAcceleratedTime;
- toUpdate.put("earliest_time", earliestAcceleratedTime);
- }
-
- /**
- * Return the cron schedule on which the cached data for acceleration should be
- * updated.
- *
- * @return a string containing a crontab style schedule specification.
- */
- public String getAccelerationCronSchedule() {
- return accelerationCronSchedule;
- }
-
- /**
- * Set the cron schedule on which the cached data for the acceleration should
- * be updated.
- *
- * @param accelerationCronSchedule a crontab style schedule to use.
- */
- public void setAccelerationCronSchedule(String accelerationCronSchedule) {
- this.accelerationCronSchedule = accelerationCronSchedule;
- toUpdate.put("cron_schedule", accelerationCronSchedule);
- }
-
- /**
- * This setting prevents outdated summaries from being rebuilt by the
- * 'summarize' command.
- *
- * @return whether manual rebuilds are enabled for this data model.
- */
- public boolean isManualRebuilds() {
- return this.manualRebuilds;
- }
-
- /**
- * Enable or disable manual rebuilds on this data model.
- *
- * @param enabled true enabled, false disables.
- */
- public void setManualRebuilds(boolean enabled) {
- this.manualRebuilds = enabled;
- toUpdate.put("manual_rebuilds", enabled);
- }
-
- @Override
- public void update() {
- // We have to do some munging on the acceleration fields to pass them as JSON
- // to the server.
- Map accelerationMap = new HashMap();
- for (String key : new String[] {"enabled", "earliest_time", "cron_schedule", "manual_rebuilds"}) {
- if (toUpdate.containsKey(key)) {
- accelerationMap.put(key, toUpdate.get(key));
- toUpdate.remove(key);
- }
- }
-
- if (!accelerationMap.isEmpty()) {
- toUpdate.put("acceleration", gson.toJson(accelerationMap));
- }
-
- // Now update like we would any other entity.
- super.update();
- }
-}
diff --git a/splunk/src/main/java/com/splunk/DataModelArgs.java b/splunk/src/main/java/com/splunk/DataModelArgs.java
deleted file mode 100644
index a9d0fb7a..00000000
--- a/splunk/src/main/java/com/splunk/DataModelArgs.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-/**
- * Class representing arguments to creating a data model.
- *
- * At the moment this is a very minimal class, supporting only the
- * description field for writing raw JSON to the server.
- */
-public class DataModelArgs extends Args {
- public String getRawJsonDescription() { return (String) get("description"); }
- public void setRawJsonDescription(String rawJson) { put("description", rawJson); }
-}
diff --git a/splunk/src/main/java/com/splunk/DataModelCalculation.java b/splunk/src/main/java/com/splunk/DataModelCalculation.java
deleted file mode 100644
index 499c0584..00000000
--- a/splunk/src/main/java/com/splunk/DataModelCalculation.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package com.splunk;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-
-import java.util.*;
-import java.util.Map.Entry;
-
-/**
- * Abstract class specifying a calculation on a data model object.
- */
-public abstract class DataModelCalculation {
- private final String[] ownerLineage;
- private final String calculationID;
- private final Map generatedFields;
- private final String comment;
- private final boolean editable;
-
- protected DataModelCalculation(String[] ownerLineage, String calculationID,
- Map generatedFields, String comment, boolean editable) {
- this.ownerLineage = ownerLineage;
- this.calculationID = calculationID;
- this.generatedFields = generatedFields;
- this.comment = comment;
- this.editable = editable;
- }
-
- /**
- * @return the ID of this calculation.
- */
- public String getCalculationID() { return this.calculationID; }
-
- /**
- * @param fieldName Name of the field to fetch.
- * @return whether this calculation generated a field of the given name.
- */
- public boolean containsGeneratedField(String fieldName) {
- return this.generatedFields.containsKey(fieldName);
- }
-
- /**
- * @return a collection of the fields this calculation generates.
- */
- public Collection getGeneratedFields() {
- return Collections.unmodifiableCollection(this.generatedFields.values());
- }
-
- /**
- * @param fieldName Name of the field to fetch.
- * @return a DataModelField object.
- */
- public DataModelField getGeneratedField(String fieldName) { return this.generatedFields.get(fieldName); }
-
- /**
- * @return the comment on this calculation (if one is specified) or null.
- */
- public String getComment() { return this.comment; }
-
- /**
- * Returns the name of the object on which this calculation is defined.
- * That need not be the one you accessed it from, as it may be inherited from
- * another data model object.
- *
- * @return The name of the object on which this calculation is defined.
- */
- public String getOwner() { return this.ownerLineage[this.ownerLineage.length-1]; }
-
- /**
- * Return the lineage of the data model object on which this calculation is
- * defined, starting with the most remote ancestor and ending with the data model object
- * on which this calculation is defined.
- *
- * @return an array of the names of data model objects.
- */
- public String[] getLineage() { return this.ownerLineage; }
-
- /**
- * @return whether this calculation can be edited, or it is a system defined calculation.
- */
- public boolean isEditable() { return this.editable; }
-
- static DataModelCalculation parse(JsonElement json) {
- String type = null;
- String calculationId = null;
- List lookupInputs =
- new ArrayList();
- String comment = null;
- String expression = null;
- String lookupName = null;
- String lookupField = null; // We need lookupField and inputField to handle the case in Splunk 6.0
- String inputField = null; // where there is only one entry, and it's not in an array.
- String[] owner = new String[0]; // Should always be set below
- boolean editable = false;
- Map outputFields = new HashMap();
-
- String key;
- for (Entry entry : json.getAsJsonObject().entrySet()) {
- key = entry.getKey();
- if (key.equals("calculationType")) {
- type = entry.getValue().getAsString().toLowerCase();
- } else if (key.equals("calculationID")) {
- calculationId = entry.getValue().getAsString();
- } else if (key.equals("outputFields")) {
- for (JsonElement e : entry.getValue().getAsJsonArray()) {
- DataModelField f = DataModelField.parse(e.getAsJsonObject());
- outputFields.put(f.getName(), f);
- }
- } else if (key.equals("lookupInputs")) {
- for (JsonElement lookupInputJsonElement : entry.getValue().getAsJsonArray()) {
- if (!(lookupInputJsonElement instanceof JsonObject)) {
- throw new RuntimeException("Expected a JSON object for lookupInput entry.");
- }
- JsonObject lookupInputJson = (JsonObject)lookupInputJsonElement;
- LookupDataModelCalculation.LookupFieldMapping mapping = new LookupDataModelCalculation.LookupFieldMapping();
- mapping.inputField = lookupInputJson.get("inputField").getAsString();
- mapping.lookupField = lookupInputJson.get("lookupField").getAsString();
- lookupInputs.add(mapping);
- }
- } else if (key.equals("inputField")) {
- inputField = entry.getValue().getAsString();
- } else if (key.equals("comment")) {
- comment = entry.getValue().getAsString();
- } else if (key.equals("expression")) {
- expression = entry.getValue().getAsString();
- } else if (key.equals("lookupName")) {
- lookupName = entry.getValue().getAsString();
- } else if (key.equals("lookupField")) {
- lookupField = entry.getValue().getAsString();
- } else if (key.equals("owner")) {
- owner = entry.getValue().getAsString().split("\\.");
- } else if (key.equals("editable")) {
- editable = entry.getValue().getAsBoolean();
- }
- }
-
- DataModelCalculation c;
- if (type.equals("lookup")) {
- c = new LookupDataModelCalculation(owner, calculationId, outputFields, comment, editable, lookupName, lookupInputs);
- } else if (type.equals("geoip")) {
- c = new GeoIPDataModelCalculation(owner, calculationId, outputFields, comment, editable, inputField);
- } else if (type.equals("eval")) {
- c = new EvalDataModelCalculation(owner, calculationId, outputFields, comment, editable, expression);
- } else if (type.equals("rex")) {
- c = new RegexpDataModelCalculation(owner, calculationId, outputFields, comment, editable, inputField, expression);
- } else {
- throw new IllegalStateException("Unknown calculation type: " + type);
- }
-
- return c;
- }
-}
diff --git a/splunk/src/main/java/com/splunk/DataModelCollection.java b/splunk/src/main/java/com/splunk/DataModelCollection.java
deleted file mode 100644
index dfad8544..00000000
--- a/splunk/src/main/java/com/splunk/DataModelCollection.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package com.splunk;
-
-import java.util.Map;
-
-public class DataModelCollection extends EntityCollection {
- DataModelCollection(Service service) {
- super(service, "datamodel/model", DataModel.class);
- this.refreshArgs.put("concise", "0");
- }
-
- /**
- * Creates an entity in this collection.
- *
- * @param name The name of the entity.
- * @return The entity.
- */
- @Override
- public DataModel create(String name) {
- return create(name, (Map)null);
- }
-
- /**
- * Creates an entity in this collection.
- *
- * @param name The name of the entity.
- * @param args Arguments for creating the entity.
- * @return The entity.
- */
- @Override
- public DataModel create(String name, Map args) {
- Args revisedArgs = Args.create(args);
- // concise=0 forces the server to return all details of the newly
- // created data model.
- if (!args.containsKey("concise")) {
- revisedArgs = revisedArgs.add("concise", "0");
- }
- return super.create(name, revisedArgs);
- }
-}
diff --git a/splunk/src/main/java/com/splunk/DataModelConstraint.java b/splunk/src/main/java/com/splunk/DataModelConstraint.java
deleted file mode 100644
index 7f7126b4..00000000
--- a/splunk/src/main/java/com/splunk/DataModelConstraint.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package com.splunk;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-
-import java.util.Map.Entry;
-
-/**
- * Represents a constraint on a data model object or a field on a data model object.
- */
-public class DataModelConstraint {
- private String owner;
- private String query;
-
- private DataModelConstraint() {
- }
-
- /**
- * @return The Splunk search query this constraint specifies.
- */
- public String getQuery() { return this.query; }
-
-
- /**
- * @return The DataModelObject that owns this field.
- */
- public String getOwner() { return this.owner; }
-
- /**
- * Parse a DataModelConstraint object out of JSON.
- *
- * @param json JsonElement to parse.
- * @return a DataModelConstraint object.
- */
- static DataModelConstraint parse(JsonElement json) {
- JsonObject jsonObject = json.getAsJsonObject();
- DataModelConstraint constraint = new DataModelConstraint();
-
- for (Entry e : jsonObject.entrySet()) {
- if (e.getKey().equals("owner")) {
- constraint.owner = e.getValue().getAsString();
- } else if (e.getKey().equals("search")) {
- constraint.query = e.getValue().getAsString();
- }
- }
-
- return constraint;
- }
-}
diff --git a/splunk/src/main/java/com/splunk/DataModelField.java b/splunk/src/main/java/com/splunk/DataModelField.java
deleted file mode 100644
index d83dca1c..00000000
--- a/splunk/src/main/java/com/splunk/DataModelField.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package com.splunk;
-
-import com.google.gson.JsonElement;
-
-import java.util.Map.Entry;
-
-/**
- * Represents a field of a data model object.
- */
-public class DataModelField {
- private String[] ownerLineage;
- private String name;
- private FieldType type;
- private boolean required;
- private boolean multivalued;
- private boolean hidden;
- private String displayName;
- private String comment;
- private boolean editable;
- private String fieldSearch;
-
- private DataModelField() {}
-
- /**
- * @return a search query fragment for this field.
- */
- public String getFieldSearch() { return this.fieldSearch; }
-
- /**
- * @return The name of this field.
- */
- public String getName() { return this.name; };
-
- /**
- * Return the name of the data model object on which this field is defined. That need not
- * be the data model object you accessed it from. It can be one of its ancestors.
- *
- * @return The name of the DataModelObject that owns this field.
- */
- public String getOwnerName() { return this.ownerLineage[this.ownerLineage.length-1]; }
-
- /**
- * Return the lineage of the data model object on which this field is defined. That need not
- * be the data model object you accessed it from. It can be one of its ancestors.
- *
- * @return An array of names of DataModelObjects representing the lineage of this field's owner.
- */
- public String[] getOwnerLineage() { return this.ownerLineage; }
-
- /**
- * @return The type of this field.
- */
- public FieldType getType() { return this.type; }
-
- /**
- * Some fields are part of system objects such as BaseEvent or are part
- * of the structure of the object, such as a field with the same name
- * as the object. Those fields cannot be edited. This method returns
- * whether the field is one of these protected fields.
- *
- * @return whether this field can be edited.
- */
- public boolean isEditable() { return editable; }
-
- /**
- * @return whether this field is required on events in the object.
- */
- public boolean isRequired() { return required; }
-
- /**
- * @return whether this field is can be multivalued.
- */
- public boolean isMultivalued() { return multivalued; }
-
- /**
- * @return whether this field should be displayed in a data model UI.
- */
- public boolean isHidden() { return hidden; }
-
- /**
- * @return a human readable name for this field.
- */
- public String getDisplayName() { return displayName; }
-
- /**
- * @return a comment on this field (if there is one), or null.
- */
- public String getComment() { return comment; }
-
- public static DataModelField parse(JsonElement fieldJson) {
- DataModelField field = new DataModelField();
-
- for (Entry entry : fieldJson.getAsJsonObject().entrySet()) {
- if (entry.getKey().equals("fieldName")) {
- field.name = entry.getValue().getAsString();
- } else if (entry.getKey().equals("owner")) {
- field.ownerLineage = entry.getValue().getAsString().split("\\.");
- } else if (entry.getKey().equals("type")) {
- field.type = FieldType.parseType(entry.getValue().getAsString());
- } else if (entry.getKey().equals("required")) {
- field.required = entry.getValue().getAsBoolean();
- } else if (entry.getKey().equals("multivalue")) {
- field.multivalued = entry.getValue().getAsBoolean();
- } else if (entry.getKey().equals("hidden")) {
- field.hidden = entry.getValue().getAsBoolean();
- } else if (entry.getKey().equals("displayName")) {
- field.displayName = entry.getValue().getAsString();
- } else if (entry.getKey().equals("comment")) {
- //Before Splunk 7, comment value was just a string but now, its JSON ("comment": {"description": "The body of a message."})
- if(entry.getValue().isJsonObject()) {
- field.comment = entry.getValue().getAsJsonObject().get("description").getAsString();
- } else {
- field.comment = entry.getValue().getAsString();
- }
- } else if (entry.getKey().equals("editable")) {
- field.editable = entry.getValue().getAsBoolean();
- } else if (entry.getKey().equals("fieldSearch")) {
- field.fieldSearch = entry.getValue().getAsString();
- }
- }
-
- return field;
- }
-}
-
diff --git a/splunk/src/main/java/com/splunk/DataModelObject.java b/splunk/src/main/java/com/splunk/DataModelObject.java
deleted file mode 100644
index 75c84d88..00000000
--- a/splunk/src/main/java/com/splunk/DataModelObject.java
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package com.splunk;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-
-import java.util.*;
-import java.util.Map.Entry;
-
-/**
- * DataModelObject represents one of the structured views in a data model.
- */
-public class DataModelObject {
- private DataModel model;
- private String name;
- private String[] lineage;
- private String displayName;
- private String parentName;
-
- private Map autoextractedFields;
- private Collection constraints;
- private Map calculations;
-
- protected DataModelObject(DataModel model) {
- this.model = model;
- }
-
- /**
- * Checks whether there is a field with the given name in this
- * data model object.
- *
- * @param fieldName name of the field to check for.
- * @return true if there is such a field; false otherwise.
- */
- public boolean containsField(String fieldName) {
- if (autoextractedFields.containsKey(fieldName)) {
- return true;
- }
- for (DataModelCalculation c : calculations.values()) {
- if (c.containsGeneratedField(fieldName)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Local acceleration is tsidx acceleration of a data model object that is handled
- * manually by a user. You create a job which generates an index, and then use that
- * index in your pivots on the data model object.
- *
- * The namespace created by the job is 'sid={sid}' where {sid} is the job's sid. You
- * would use it in another job by starting your search query with
- *
- * | tstats ... from sid={sid} | ...
- *
- * The tsidx index created by this job is deleted when the job is garbage collected
- * by Splunk.
- *
- * It is the user's responsibility to manage this job, including cancelling it.
- *
- * @return a Job writing a tsidx index.
- */
- public Job createLocalAccelerationJob() {
- return createLocalAccelerationJob(null);
- }
-
- /**
- * Local acceleration is tsidx acceleration of a data model object that is handled
- * manually by a user. You create a job which generates an index, and then use that
- * index in your pivots on the data model object.
- *
- * The namespace created by the job is 'sid={sid}' where {sid} is the job's sid. You
- * would use it in another job by starting your search query with
- *
- * | tstats ... from sid={sid} | ...
- *
- * The tsidx index created by this job is deleted when the job is garbage collected
- * by Splunk.
- *
- * It is the user's responsibility to manage this job, including cancelling it.
- *
- * @param earliestTime A time modifier (e.g., "-2w") setting the earliest time to index.
- * @return a Job writing a tsidx index.
- */
- public Job createLocalAccelerationJob(String earliestTime) {
- String query = "| datamodel " + this.model.getName() + " " +
- this.getName() + " search | tscollect";
- JobArgs args = new JobArgs();
- if (earliestTime != null) {
- args.setEarliestTime(earliestTime);
- }
- return this.model.getService().search(query, args);
- }
-
- /**
- * Return the calculations done by this data model object to produce fields.
- *
- * Each calculation has a unique ID assigned to it by splunkd, which is the key
- * in the returned map. For most purposes you will probably only want the values.
- *
- * @return a map of calculation IDs to DataModelCalculation objects.
- */
- public Map getCalculations() {
- return Collections.unmodifiableMap(this.calculations);
- }
-
- /**
- * Fetch a calculation by its unique ID.
- *
- * @param calculationId a splunkd assigned unique ID for this calculation.
- * @return a DataModelCalculation object.
- */
- public DataModelCalculation getCalculation(String calculationId) {
- return this.calculations.get(calculationId);
- }
-
- /**
- * @return a collection of the constraints limiting events that will appear in this data model object.
- */
- public Collection getConstraints() {
- return Collections.unmodifiableCollection(this.constraints);
- }
-
- /**
- * Fetch the data model on which this object is defined.
- *
- * @return A DataModel instance containing this object.
- */
- public DataModel getDataModel() {
- return this.model;
- }
-
- /**
- * @return the human readable name of this data model object.
- */
- public String getDisplayName() {
- return this.displayName;
- }
-
- /**
- * Fetch a single field of a given name from this data model object.
- *
- * @param fieldName Name of the field to fetch.
- * @return A DataModelField object, or null if there is no field of the given name.
- */
- public DataModelField getField(String fieldName) {
- if (autoextractedFields.containsKey(fieldName)) {
- return autoextractedFields.get(fieldName);
- }
- for (DataModelCalculation c : this.calculations.values()) {
- if (c.containsGeneratedField(fieldName)) {
- return c.getGeneratedField(fieldName);
- }
- }
- return null;
- }
-
- /**
- * Get a collection of objects specifying all the fields that were automatically extracted
- * from events (as opposed to generated by calculations in a data model).
- *
- * @return a collection of DataModelField objects.
- */
- public Collection getAutoExtractedFields() {
- return Collections.unmodifiableCollection(autoextractedFields.values());
- }
-
- /**
- * Return all the fields, whether input or created by calculations.
- * @return a collection of DataModelField objects.
- */
- public Collection getFields() {
- Collection fields = new ArrayList();
- fields.addAll(this.autoextractedFields.values());
- for (DataModelCalculation c : this.calculations.values()) {
- fields.addAll(c.getGeneratedFields());
- }
- return fields;
- }
-
- public String getQuery() {
- return "| datamodel " + this.getDataModel().getName() + " " + this.getName() + " search";
- }
-
- /**
- * @return Splunk's identifier for this data model object.
- */
- public String getName() { return this.name; }
-
- /**
- * Data model objects can inherit from other data model objects
- * in the same data model (or from a couple of global base objects
- * such as BaseEvent and BaseTransaction). The lineage is a list of
- * data model object names tracing this inheritance, starting with the
- * most remote ancestor and ending with this object.
- *
- * @return An array of names, starting with this object's name, followed by
- * the names up the hierarchy.
- */
- public String[] getLineage() { return this.lineage; }
-
- /**
- * Returns the name of the parent of this object.
- *
- * @return a String giving the name.
- */
- public String getParentName() {
- return this.parentName;
- }
-
- /**
- * @return the data model object this one inherits from if it is a user defined data model object
- * in the same data model; otherwise returns null (for example if the data model object inherits from BaseEvent
- * or BaseTransaction).
- */
- public DataModelObject getParent() {
- return this.getDataModel().getObject(this.parentName);
- }
-
- /**
- * Create a PivotSpecification on this data model object.
- *
- * @return a PivotSpecification instance.
- */
- public PivotSpecification createPivotSpecification() {
- return new PivotSpecification(this);
- }
-
- /**
- * Start a job that fetches all the events of this data model object.
- *
- * @return a Job object.
- */
- public Job runQuery() {
- return runQuery("", null);
- }
-
- /**
- * Start a job that fetches all the events of this data model object.
- *
- * @param args arguments specifying behavior of the job.
- * @return a Job object.
- */
- public Job runQuery(JobArgs args) {
- return runQuery("", args);
- }
-
- /**
- * Start a job that applies querySuffix to all the events in this data model object.
- *
- * @param querySuffix a search query, starting with a '|' that will be appended to the command to fetch
- * the contents of this data model object (e.g., "| head 3").
- * @return a Job object.
- */
- public Job runQuery(String querySuffix) {
- return runQuery(querySuffix, null);
- }
-
- /**
- * Start a job that applies querySuffix to all the events in this data model object.
- *
- * @param querySuffix a search query, starting with a '|' that will be appended to the command to fetch
- * the contents of this data model object (e.g., "| head 3").
- * @param args arguments to control the job.
- * @return a Job object.
- */
- public Job runQuery(String querySuffix, JobArgs args) {
- return getDataModel().getService().search(getQuery() + querySuffix, args);
- }
-
- /**
- * Produce a data model object from a JSON dictionary specifying it plus a data model that contains it.
-
- * @param dataModel a DataModel instance that contains this data model object.
- * @param object a JsonElement (as produced by Gson) specifying this data model object (usually one of
- * the entries in the array of objects in the JSON description of the data model).
- * @return a DataModelObject instance.
- */
- static DataModelObject parse(DataModel dataModel, JsonElement object) {
- String name = null;
- String displayName = null;
- String comment = null;
- String[] lineage = new String[0];
- String parentName = null;
- Map fields = new HashMap();
- Collection children = new ArrayList();
- Collection constraints = new ArrayList();
- Map calculations = new HashMap();
-
- // Fields specific to objects inheriting directly from BaseSearch.
- String baseSearch = null;
- // Fields specific to objects inheriting directly from BaseTransaction
- String transactionMaxPause = null;
- String transactionMaxTimeSpan = null;
- Collection groupByFields = new ArrayList();
- Collection objectsToGroup = new ArrayList();
-
- for (Entry entry : object.getAsJsonObject().entrySet()) {
- if (entry.getKey().equals("objectName")) {
- name = entry.getValue().getAsString();
- } else if (entry.getKey().equals("displayName")) {
- displayName = entry.getValue().getAsString();
- } else if (entry.getKey().equals("lineage")) {
- lineage = entry.getValue().getAsString().split("\\.");
- } else if (entry.getKey().equals("parentName")) {
- parentName = entry.getValue().getAsString();
- } else if (entry.getKey().equals("fields")) {
- JsonArray fieldsJson = entry.getValue().getAsJsonArray();
- fields.clear();
-
- for (JsonElement fieldJson : fieldsJson) {
- DataModelField field = DataModelField.parse(fieldJson);
- fields.put(field.getName(), field);
- }
- } else if (entry.getKey().equals("constraints")) {
- JsonArray constraintsJson = entry.getValue().getAsJsonArray();
-
- for (JsonElement constraintJson : constraintsJson) {
- DataModelConstraint constraint = DataModelConstraint.parse(constraintJson);
- constraints.add(constraint);
- }
- } else if (entry.getKey().equals("calculations")) {
- calculations.clear();
- for (JsonElement cjson : entry.getValue().getAsJsonArray()) {
- DataModelCalculation c = DataModelCalculation.parse(cjson);
- String cid = c.getCalculationID();
- calculations.put(cid, c);
- }
- } else if (entry.getKey().equals("baseSearch")) {
- baseSearch = entry.getValue().getAsString();
- } else if (entry.getKey().equals("transactionMaxPause")) {
- transactionMaxPause = entry.getValue().getAsString();
- } else if (entry.getKey().equals("transactionMaxTimeSpan")) {
- transactionMaxTimeSpan = entry.getValue().getAsString();
- } else if (entry.getKey().equals("groupByFields")) {
- for (JsonElement e : entry.getValue().getAsJsonArray()) {
- groupByFields.add(e.getAsString());
- }
- } else if (entry.getKey().equals("objectsToGroup")) {
- for (JsonElement e : entry.getValue().getAsJsonArray()) {
- objectsToGroup.add(e.getAsString());
- }
- }
- }
-
- DataModelObject dmo;
- // Create the right subclass of DataModelObject.
- if (baseSearch != null) {
- dmo = new DataModelSearch(dataModel);
- } else if (transactionMaxPause != null) {
- dmo = new DataModelTransaction(dataModel);
- } else {
- dmo = new DataModelObject(dataModel);
- }
-
- // Set the fields common to all data model objects
- dmo.name = name;
- dmo.displayName = displayName;
- dmo.lineage = lineage;
- dmo.parentName = parentName;
- dmo.autoextractedFields = fields;
- dmo.constraints = constraints;
- dmo.calculations = calculations;
-
- // Set the fields of particular types
- if (baseSearch != null) {
- ((DataModelSearch)dmo).baseSearch = baseSearch;
- } else if (transactionMaxPause != null) {
- ((DataModelTransaction)dmo).groupByFields = groupByFields;
- ((DataModelTransaction)dmo).objectsToGroup = objectsToGroup;
- ((DataModelTransaction)dmo).maxPause = transactionMaxPause;
- ((DataModelTransaction)dmo).maxSpan = transactionMaxTimeSpan;
- } else {
- // Has no additional fields
- }
-
- return dmo;
- }
-}
diff --git a/splunk/src/main/java/com/splunk/DataModelSearch.java b/splunk/src/main/java/com/splunk/DataModelSearch.java
deleted file mode 100644
index 87f2e37f..00000000
--- a/splunk/src/main/java/com/splunk/DataModelSearch.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package com.splunk;
-
-/**
- * DataModelSearch represents a data model object that directly wraps a Splunk search query.
- *
- * It appears only as a direct subobject of the BaseSearch built-in type. All its children
- * appear as normal DataModelObject instances. DataModelSearch objects have one additional
- * getter, getBaseSearch, which returns the underlying search which this object
- * wraps.
- */
-public class DataModelSearch extends DataModelObject {
- protected String baseSearch;
-
- DataModelSearch(DataModel model) {
- super(model);
- }
-
- /**
- * @return the search query wrapped by this data model object.
- */
- public String getBaseSearch() {
- return baseSearch;
- }
-}
diff --git a/splunk/src/main/java/com/splunk/DataModelTransaction.java b/splunk/src/main/java/com/splunk/DataModelTransaction.java
deleted file mode 100644
index a95d07a0..00000000
--- a/splunk/src/main/java/com/splunk/DataModelTransaction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2014 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package com.splunk;
-
-import java.util.Collection;
-
-/**
- * Represents a datamodel object that inherits directly from BaseTransaction,
- * that is, an object that wraps a Splunk transaction. All children of this
- * object will appears as standard DataModelObject instances.
- */
-public class DataModelTransaction extends DataModelObject {
- protected Collection groupByFields;
- protected Collection objectsToGroup;
- protected String maxSpan;
- protected String maxPause;
-
- DataModelTransaction(DataModel dataModel) {
- super(dataModel);
- }
-
- /**
- * @return the fields that will be used to group events into transactions.
- *
- * Contiguous events with identical values of the fields named in this collection
- * will be grouped into transactions.
- */
- public Collection getGroupByFields() { return this.groupByFields; }
-
- /**
- * @return the names of the data model objects that should be unioned and split into transactions.
- */
- public Collection getObjectsToGroup() { return this.objectsToGroup; }
-
- /**
- * maxSpan is the maximum amount of time (in a Splunk defined format, such as "1m"
- * for one minute or "20s" for twenty seconds) that a single transaction can span.
- * When a transaction reaches this size, it is automatically ended and a new transaction
- * begun.
- *
- * @return The maximum time that a transaction can span.
- */
- public String getMaxSpan() { return this.maxSpan; }
-
- /**
- * maxPause is the maximum amount of time between two events in a transaction, specified as a string
- * such as "1m" for one minute or "20s" for twenty seconds. When a transaction
- * has a gap of at least maxPause since its last even, it is ended and a new transaction begun.
- *
- * @return the maximum pause between events in a transaction.
- */
- public String getMaxPause() { return this.maxPause; }
-}
diff --git a/splunk/src/main/java/com/splunk/DeploymentClient.java b/splunk/src/main/java/com/splunk/DeploymentClient.java
deleted file mode 100644
index b67e3a2b..00000000
--- a/splunk/src/main/java/com/splunk/DeploymentClient.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-/**
- * The {@code DeploymentClient} class represents a Splunk deployment client,
- * providing access to deployment client configuration and status.
- */
-public class DeploymentClient extends Entity {
-
- /**
- * Class constructor.
- *
- * @param service The connected {@code Service} instance.
- */
- DeploymentClient(Service service) {
- super(service, "deployment/client");
- }
-
- /**
- * Displays the action path.
- *
- * @param action The requested action.
- * @return The action path.
- */
- @Override protected String actionPath(String action) {
- if (action.equals("edit"))
- return path + "/deployment-client";
- return super.actionPath(action);
- }
-
- /** Not supported for this endpoint. */
- @Override public void disable() {
- throw new UnsupportedOperationException();
- }
-
- /** Not supported for this endpoint. */
- @Override public void enable() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns the list of server classes.
- *
- * @return The list of server classes, or {@code null} if not specified.
- */
- public String [] getServerClasses() {
- return getStringArray("serverClasses", null);
- }
-
- /**
- * Returns the target URI of the deployment server for this deployment
- * client.
- *
- * @return The target URI of the deployment server in the
- * format "server:port", or {@code null} if not specified.
- */
- public String getTargetUri() {
- return getString("targetUri", null);
- }
-
- /**
- * Reloads the deployment client from the configuration file.
- */
- public void reload() {
- service.get(path + "/deployment-client/Reload");
- invalidate();
- }
-
- /**
- * Sets whether to enable or disable the deployment client.
- *
- * Note: Using this method requires you to restart Splunk before this
- * setting takes effect. To avoid restarting Splunk, use the
- * {@code Entity.disable} and {@code Entity.enable} methods instead, which
- * take effect immediately.
- * @see Entity#disable
- * @see Entity#enable
- *
- * @param disabled {@code true} to disable the deployment client,
- * {@code false} to enable it.
- */
- public void setDisabled(boolean disabled) {
- setCacheValue("disabled", disabled);
- }
-
- /**
- * Sets the deployment server's target URI for this deployment client. The
- * form of this URI is "deployment_server_uir:port".
- *
- * @param targetUri The target URI of the deployment server.
- */
- public void setTargetUri(String targetUri) {
- setCacheValue("targetUri", targetUri);
- }
-}
-
diff --git a/splunk/src/main/java/com/splunk/DeploymentServer.java b/splunk/src/main/java/com/splunk/DeploymentServer.java
deleted file mode 100644
index df1bb20b..00000000
--- a/splunk/src/main/java/com/splunk/DeploymentServer.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-/**
- * The {@code DeploymentServer} class represents a Splunk deployment server,
- * and provides access to the configurations of all deployment servers.
- */
-public class DeploymentServer extends Entity {
-
- /**
- * Class constructor.
- *
- * @param service The connected {@code Service} instance.
- * @param path The deployment server endpoint.
- */
- DeploymentServer(Service service, String path) {
- super(service, path);
- }
-
- /**
- * Returns inclusive criteria for determining deployment client access to
- * this deployment server.
- *
- * @param index The index of the whitelist entry to return.
- * @return A list of included client addresses, or {@code null} if not
- * specified.
- */
- public String getWhitelistByIndex(int index) {
- return getString(String.format("whitelist.%d", index), null);
- }
-
- /**
- * Sets whether the deployment server is enabled or disabled.
- *
- * Note: Using this method requires you to restart Splunk before this
- * setting takes effect. To avoid restarting Splunk, use the
- * {@code Entity.disable} and {@code Entity.enable} methods instead, which
- * take effect immediately.
- * @see Entity#disable
- * @see Entity#enable
- *
- * @param disabled {@code true} to disable the deployment client,
- * {@code false} to enable it.
- */
- public void setDisabled(boolean disabled) {
- setCacheValue("disabled", disabled);
- }
-}
diff --git a/splunk/src/main/java/com/splunk/DeploymentServerClass.java b/splunk/src/main/java/com/splunk/DeploymentServerClass.java
deleted file mode 100644
index e2c3c31d..00000000
--- a/splunk/src/main/java/com/splunk/DeploymentServerClass.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-/**
- * The {@code DeploymentServerClass} class represents a Splunk deployment server
- * class, providing access to the configuration of a server class.
- */
-public class DeploymentServerClass extends Entity {
-
- /**
- * Class constructor.
- *
- * @param service The connected {@code Service} instance.
- * @param path The deployment server class endpoint.
- */
- DeploymentServerClass(Service service, String path) {
- super(service, path);
- }
-
- /**
- * Returns a list of the hosts that are excluded from this server class.
- *
- * @return A comma-separated list of excluded hosts, or {@code null} if not
- * specified.
- */
- public String getBlacklist() {
- return getString("blacklist", null);
- }
-
- /**
- * Returns a list of excluded client addresses, by index.
- *
- * @param index The index of the blacklist entry to return. The only valid
- * index is 0.
- * @return A list of excluded client addresses, or {@code null} if not
- * specified.
- */
- public String getBlacklistByIndex(int index) {
- return getString(String.format("blacklist.%d", index), null);
- }
-
- /**
- * Indicates whether look-ups halt on the first server match or continue
- * to match against multiple servers. Matching is done in the order that
- * server classes are defined.
- *
- * @return {@code true} if configuration look-ups continue matching server
- * classes, beyond the first match. {@code false} if only the first match
- * is used.
- */
- public boolean getContinueMatching() {
- return getBoolean("continueMatching", false);
- }
-
- /**
- * Returns the URL template string, which specifies the endpoint from which
- * content can be downloaded by a deployment client.
- *
- * @return The URL template string for deployment client downloads, or
- * {@code null} if not specified.
- */
- public String getEndpoint() {
- return getString("endpoint", null);
- }
-
- /**
- * Returns the filter type that is applied first. If {@code filterType} is
- * "whitelist", all whitelist filters are applied first, followed by
- * blacklist filters. If {@code filterType} is "blacklist", all blacklist
- * filters are applied first, followed by whitelist filters.
- *
- * @return The filter type.
- */
- public String getFilterType() {
- return getString("filterType");
- }
-
- /**
- * Returns the location on the deployment server to store the content
- * that is to be deployed for this server class.
- *
- * Note: The path may contain macro expansions or substitutions.
- *
- * @return The file path for content storage on the deployment server.
- */
- public String getRepositoryLocation() {
- return getString("repositoryLocation");
- }
-
- /**
- * Returns the location on the deployment client where the content to be
- * deployed for this server class should be installed.
- *
- * Note: The path may contain macro expansions or substitutions.
- *
- * @return The file path for content storage on the deployment client.
- */
- public String getTargetRepositoryLocation() {
- return getString("targetRepositoryLocation", null);
- }
-
- /**
- * Returns the location of the working folder used by the deployment server.
- *
- * Note: The path may contain macro expansions or substitutions.
- *
- * @return The path to the deployment server's working folder, or
- * {@code null} if not specified.
- */
- public String getTmpFolder() {
- return getString("tmpFolder", null);
- }
-
- /**
- * Returns a list of hosts included for this server class.
- * @return A comma-separated list of included hosts, or {@code null} if not
- * specified.
- */
- public String getWhitelist() {
- return getString("whitelist", null);
- }
-
- /**
- * Returns a list of included client addresses, by index.
- *
- * @param index The index of the whitelist entry to return. Valid indexes
- * are 0 and 1.
- * @return A list of included client addresses, or {@code null} if not
- * specified.
- */
- public String getWhitelistByIndex(int index) {
- return getString(String.format("whitelist.%d", index), null);
- }
-
- /**
- * Sets a specific blacklist entry.
- *
- * @param index The index of the blacklist entry to set.
- * @param blacklist The blacklist entry.
- */
- public void setBlacklistByIndex(int index, String blacklist) {
- setCacheValue(String.format("blacklist.%d", index), blacklist);
- }
-
- /**
- * Sets how this deployment server class controls its configurations
- * across classes and server-specific settings. If set to {@code true},
- * configuration look-ups continue matching server classes after the first
- * match. If set to {@code false}, only the first match is used. Matching
- * is done in the order that server classes are defined.
- *
- * @param matching {@code true} to continue matching, {@code false} to use
- * the first match.
- */
- public void setContinueMatching(boolean matching) {
- setCacheValue("continueMatching", matching);
- }
-
- /**
- * Sets a URL template string that specifies the endpoint from which
- * content can be downloaded by a deployment client. The deployment client
- * knows how to substitute the values of the variables in the URL. Any
- * custom URL can be provided here as long as it uses the specified
- * variables.
- *
- * You don't have to set this URL template string unless you have a very
- * specific need--for example, you need to acquire deployment application
- * files from a third-party httpd for extremely large environments.
- *
- * @param endPoint The endpoint URL.
- */
- public void setEndPoint(String endPoint) {
- setCacheValue("endpoint", endPoint);
- }
-
- /**
- * Sets the order to apply filters:
- *
"whitelist" applies the whitelist filters first, followed by
- * blacklist filters.
- *
"blacklist" applies the blacklist filters first, followed by
- * whitelist filters.
- *
- * @param filterType The filter type to apply first.
- */
- public void setFilterType(String filterType) {
- setCacheValue("filterType", filterType);
- }
-
- /**
- * Sets the location on the deployment server to store the content that is
- * to be deployed for this server class.
- *
- * @param location The location (path) for storing content.
- */
- public void setRepositoryLocation(String location) {
- setCacheValue("repositoryLocation", location);
-
- }
-
- /**
- * Sets a specific whitelist entry.
- *
- * @param index The index of the whitelist entry to set.
- * @param whitelist The whitelist entry.
- */
- public void setWhitelistByIndex(int index, String whitelist) {
- setCacheValue(String.format("whitelist.%d", index), whitelist);
- }
-}
diff --git a/splunk/src/main/java/com/splunk/DeploymentTenant.java b/splunk/src/main/java/com/splunk/DeploymentTenant.java
deleted file mode 100644
index 67edff79..00000000
--- a/splunk/src/main/java/com/splunk/DeploymentTenant.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-/**
- * The {@code DeploymentTenant} class represents a Splunk deployment tenant, and
- * provides access to the multi-tenants configuration for this Splunk instance.
- */
-public class DeploymentTenant extends Entity {
-
- /**
- * Class constructor.
- *
- * @param service The connected {@code Service} instance.
- * @param path The deployment tenant endpoint.
- */
- DeploymentTenant(Service service, String path) {
- super(service, path);
- }
-
- /**
- * Returns inclusive criteria for determining deployment client access to
- * this deployment server.
- *
- * @param index The whitelist index. The only valid index is 0.
- * @return Criteria for determining deployment client access to this
- * deployment server.
- */
- public String getWhitelistByIndex(int index) {
- return getString(String.format("whitelist.%d", index), null);
- }
-
- /**
- * Sets whether the deployment tenant is enabled or disabled.
- *
- * Note: Using this method requires you to restart Splunk before this
- * setting takes effect. To avoid restarting Splunk, use the
- * {@code Entity.disable} and {@code Entity.enable} methods instead, which
- * take effect immediately.
- * @see Entity#disable
- * @see Entity#enable
- *
- * @param disabled {@code true} to disabled to deployment client,
- * {@code false} to enable.
- */
- public void setDisabled(boolean disabled) {
- setCacheValue("disabled", disabled);
- }
-}
-
diff --git a/splunk/src/main/java/com/splunk/DistributedConfiguration.java b/splunk/src/main/java/com/splunk/DistributedConfiguration.java
deleted file mode 100644
index 4105d1b4..00000000
--- a/splunk/src/main/java/com/splunk/DistributedConfiguration.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-/**
- * The {@code DistributedConfiguration} class represents a Splunk distributed
- * search configuration, providing access to Splunk's distributed search
- * options.
- */
-public class DistributedConfiguration extends Entity {
-
- /**
- * Class constructor.
- *
- * @param service The connected {@code Service} instance.
- */
- DistributedConfiguration(Service service) {
- super(service, "search/distributed/config");
- }
-
- /**
- * Returns the action path.
- *
- * @param action The requested action.
- * @return The action path.
- */
- @Override protected String actionPath(String action) {
- if (action.equals("edit"))
- return path + "/distributedSearch";
- return super.actionPath(action);
- }
-
- /**
- * Disable distributed search on this Splunk instance.
- *
- * Requires restarting Splunk before it takes effect.
- */
- @Override
- public void disable() {
- Args args = new Args();
- args.put("disabled", "1");
- update(args);
- }
-
- /**
- * Enable distributed search on this Splunk instance.
- *
- * Requires restarting Splunk before it takes effect.
- */
- @Override
- public void enable() {
- Args args = new Args();
- args.put("disabled", "0");
- update(args);
- }
-
- /**
- * Returns a list of server names that are excluded from being peers.
- *
- * @return A comma-separated list of excluded servers by name, or
- * {@code null} if not available.
- */
- public String getBlacklistNames() {
- return getString("blacklistNames", null);
- }
-
- /**
- * Returns a list of server URLs that are excluded from being peers.
- *
- * @return A comma-separated list of excluded servers by URL in the
- * format "x.x.x.x:port", or {@code null} if not available.
- */
- public String getBlacklistUrls() {
- return getString("blacklistURLs", null);
- }
-
- /**
- * Returns the time-out period for connecting to search peers.
- *
- * @return The connection time-out period, in seconds, or -1 if not
- * specified.
- */
- public int getConnectionTimeout() {
- return getInteger("connectionTimeout", -1);
- }
-
- /**
- * Returns the frequency at which servers that have timed out are rechecked.
- * If {@code removeTimedOutServers} is false, this setting has no effect.
- *
- * @return The frequency, in seconds, to recheck timed-out servers. If 0,
- * servers are not rechecked. The default is 60 seconds.
- */
- public int getCheckTimedOutServersFrequency() {
- return getInteger("checkTimedOutServersFrequency", 60);
- }
-
- /**
- * Returns the time-out period for trying to read and receive data from a
- * search peer.
- *
- * @return The receive time-out period, in seconds, or -1 if not specified.
- */
- public int getReceiveTimeout() {
- return getInteger("receiveTimeout", -1);
- }
-
- /**
- * Indicates whether timed-out servers are removed from the distributed
- * configuration.
- *
- * @return {@code true} if timed-out servers are removed from the
- * distributed configuration, {@code false} if not.
- */
- public boolean getRemovedTimedOutServers() {
- return getBoolean("removedTimedOutServers", false);
- }
-
- /**
- * Returns the time-out period for trying to write or send data to a search
- * peer.
- *
- * @return The send time-out period, in seconds, or -1 if not specified.
- */
- public int getSendTimeout() {
- return getInteger("sendTimeout", -1);
- }
-
- /**
- * Returns a list of peer servers.
- *
- * @return The comma-separated list of peer servers, or {@code null} if not
- * available.
- */
- public String getServers() {
- return getString("servers", null);
- }
-
- /**
- * Indicates whether this server uses bundle replication to share
- * search-time configuration with search peers.
- *
- * Note: If set to {@code false}, the search head assumes that the
- * search peers can access the correct bundles using an NFS share.
- *
- * @return {@code true} if this server uses bundle replication,
- * {@code false} if not.
- */
- public boolean getShareBundles() {
- return getBoolean("shareBundles", true);
- }
-
- /**
- * Returns the time-out period for gathering a search peer's basic information.
- *
- * @return The time-out period, in seconds.
- * @see ServiceInfo
- */
- public int getStatusTimeout() {
- return getInteger("statusTimeout", 10);
- }
-
- /**
- * Indicates whether distributed search is enabled.
- *
- * @return {@code true} if distributed search is enabled, {@code false} if
- * disabled.
- */
- public boolean isDistSearchEnabled() {
- return getBoolean("dist_search_enabled", true);
- }
-
- /**
- * Sets the blacklist server names that are excluded from being peers.
- *
- * @param names A comma-separated list of server names.
- */
- public void setBlacklistNames(String names) {
- setCacheValue("blacklistNames", names);
- }
-
- /**
- * Sets the blacklist server names or URIs that are excluded from being
- * peers. The format for a URI is "x.x.x.x:port".
- *
- * @param names A comma-separated list of server names or URIs.
- */
- public void setBlacklistURLs(String names) {
- setCacheValue("blacklistURLs", names);
- }
-
- /**
- * Sets the server recheck frequency.
- *
- * Note: This attribute is only relevant when
- * {@code removeTimedOutServers} is set to {@code true}--otherwise, this
- * attribute is ignored.
- * @see #getRemovedTimedOutServers
- *
- * @param frequency The server recheck frequency, in seconds. If set to 0, a
- * recheck does not occur.
- */
- public void setCheckTimedOutServersFrequency(int frequency) {
- setCacheValue("checkTimedOutServersFrequency", frequency);
- }
-
- /**
- * Sets the time-out period for establishing a search peer connection.
- *
- * @param seconds The connection time-out period, in seconds.
- */
- public void setConnectionTimeout(int seconds) {
- setCacheValue("connectionTimeout", seconds);
- }
-
- /**
- * Sets whether the distributed configuration is enabled or disabled.
- *
- * Note: Using this method requires you to restart Splunk before this
- * setting takes effect. To avoid restarting Splunk, use the
- * {@code Entity.disable} and {@code Entity.enable} methods instead, which
- * take effect immediately.
- * @see Entity#disable
- * @see Entity#enable
- *
- * @param disabled {@code true} to disabled to deployment client,
- * {@code false} to enable.
- */
- public void setDisabled(boolean disabled) {
- setCacheValue("disabled", disabled);
- }
-
- /**
- * Sets the time-out period for reading and receiving data from a search
- * peer.
- *
- * @param seconds The receive time-out period, in seconds.
- */
- public void setReceiveTimeout(int seconds) {
- setCacheValue("receiveTimeout", seconds);
- }
-
- /**
- * Sets whether to remove a server connection that cannot be made within the
- * time-out period specified by {@code connectionTimeout},
- * {@code sendTimeout}, or {@code receiveTimeout}.
- * If {@code false}, every call to that server attempts to connect, which
- * might result in a slow user interface.
- * @see #setConnectionTimeout
- * @see #setSendTimeout
- * @see #setReceiveTimeout
- *
- * @param removeTimedOutServers {@code true} to remove timed-out server
- * connections, {@code false} to attempt every call to the server.
- */
- public void setRemoveTimedOutServers(boolean removeTimedOutServers) {
- setCacheValue("removedTimedOutServers", removeTimedOutServers);
- }
-
- /**
- * Sets the time-out period for writing and sending data to a search peer.
- *
- * @param seconds The send time-out period, in seconds.
- */
- public void setSendTimeout(int seconds) {
- setCacheValue("sendTimeout", seconds);
- }
-
- /**
- * Sets the initial peer server list. You don't need to set servers here
- * if you are operating completely in {@code autoAddServers} mode
- * (discovered servers are automatically added).
- *
- * @param servers A comma-separated list of peer servers.
- */
- public void setServers(String servers) {
- setCacheValue("servers", servers);
- }
-
- /**
- * Sets whether this server uses bundle replication to share search-time
- * configuration with search peers.
- *
- * If set to {@code false}, the search head assumes that the search peers
- * can access the correct bundles using an NFS share and have correctly
- * configured the options for mounted_bundles and bundles_location in the
- * distsearch.conf file.
- *
- * @param shareBundles {@code true} to share search-time configuration
- * with peers, {@code false} if not.
- */
- public void setShareBundles(boolean shareBundles) {
- setCacheValue("shareBundles", shareBundles);
- }
-
- /**
- * Sets the time-out period for connecting to a search peer for getting its
- * basic information.
- *
- * @param seconds The connection time-out period, in seconds.
- * @see ServiceInfo
- */
- public void setStatusTimeout(int seconds) {
- setCacheValue("statusTimeout", seconds);
- }
-
-}
diff --git a/splunk/src/main/java/com/splunk/DistributedPeer.java b/splunk/src/main/java/com/splunk/DistributedPeer.java
deleted file mode 100644
index 2a42a75f..00000000
--- a/splunk/src/main/java/com/splunk/DistributedPeer.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-/**
- * The {@code DistributedPeer} class represents a Splunk distributed peer,
- * providing distributed peer server management.
- */
-public class DistributedPeer extends Entity {
-
- /**
- * Class constructor.
- *
- * @param service The connected {@code Service} instance.
- * @param path The deployment server endpoint.
- */
- DistributedPeer(Service service, String path) {
- super(service, path);
- }
-
- /**
- * Returns this peer's build number.
- *
- * @return The build number.
- */
- public String getBuild() {
- return getString("build");
- }
-
- /**
- * Returns a list of bundle versions.
- *
- * @return The bundle versions, or {@code null} if not specified.
- */
- public String[] getBundleVersions() {
- return getStringArray("bundle_versions", null);
- }
-
- /**
- * Returns this peer's GUID.
- *
- * @return The GUID, or {@code null} if not specified.
- */
- public String getGuid() {
- return getString("guid", null);
- }
-
- /**
- * Returns this peer's license signature.
- *
- * @return The license signature, or {@code null} if not specified.
- */
- public String getLicenseSignature() {
- return getString("licenseSignature", null);
- }
-
- /**
- * Returns this peer's name.
- *
- * @return The name, or {@code null} if not specified.
- */
- public String getPeerName() {
- return getString("peerName", null);
- }
-
- /**
- * Returns this peer's type.
- *
- * @return The type, or {@code null} if not specified.
- */
- public String getPeerType() {
- return getString("peerType", null);
- }
-
- /**
- * Returns this peer's replication status.
- *
- * @return The replication status, or {@code null} if not specified.
- */
- public String getReplicationStatus() {
- return getString("replicationStatus", null);
- }
-
- /**
- * Return this peer's overall status.
- *
- * @return The overall status, or {@code null} if not specified.
- */
- public String getStatus() {
- return getString("status", null);
- }
-
- /**
- * Returns this peer's version.
- *
- * @return The version, or {@code null} if not specified.
- */
- public String getVersion() {
- return getString("version", null);
- }
-
- /**
- * Indicates whether this peer is using HTTPS.
- *
- * @return {@code true} if this peer is using HTTPS, {@code false} if not.
- */
- public boolean isHttps() {
- return getBoolean("is_https", true);
- }
-
- /**
- * Sets the remote password.
- *
- * Note: The username and password must be set at the same time.
- * @see #setRemoteUsername
- *
- * @param password The remote password.
- */
- public void setRemotePassword(String password) {
- setCacheValue("remotePassword", password);
- }
-
- /**
- * Sets the remote username.
- *
- * Note: The username and password must be set at the same time.
- * @see #setRemotePassword
- *
- * @param username The remote username.
- */
- public void setRemoteUsername(String username) {
- setCacheValue("remoteUsername", username);
- }
-}
-
diff --git a/splunk/src/main/java/com/splunk/Entity.java b/splunk/src/main/java/com/splunk/Entity.java
deleted file mode 100644
index a4856e2a..00000000
--- a/splunk/src/main/java/com/splunk/Entity.java
+++ /dev/null
@@ -1,493 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-import java.util.*;
-
-/**
- * The {@code Entity} class represents a Splunk entity.
- */
-public class Entity extends Resource implements Map {
- protected Record content;
- protected HashMap toUpdate = new LinkedHashMap();
-
- /**
- * Class constructor.
- *
- * @param service The connected {@code Service} instance.
- * @param path The entity's endpoint.
- */
- public Entity(Service service, String path) {
- super(service, path);
- }
-
- /**
- * Returns the path that corresponds to the requested action.
- *
- * @param action The requested action.
- * @return The return path.
- */
- protected String actionPath(String action) {
- if (action.equals("disable"))
- return path + "/disable";
- if (action.equals("edit"))
- return path;
- if (action.equals("enable"))
- return path + "/enable";
- if (action.equals("remove"))
- return path;
- if (action.equals("acl"))
- return path + "/acl";
- throw new IllegalArgumentException("Invalid action: " + action);
- }
-
- /** {@inheritDoc} */
- public void clear() {
- throw new UnsupportedOperationException();
- }
-
- /** {@inheritDoc} */
- public boolean containsKey(Object key) {
- return getContent().containsKey(key);
- }
-
- /** {@inheritDoc} */
- public boolean containsValue(Object value) {
- return getContent().containsValue(value);
- }
-
- /**
- * Disables the entity that is named by this endpoint. This method is
- * available on almost every endpoint.
- */
- public void disable() {
- service.post(actionPath("disable"));
- invalidate();
- }
-
- /**
- * Enables the entity that is named by this endpoint. This method is
- * available on almost every endpoint.
- */
- public void enable() {
- service.post(actionPath("enable"));
- invalidate();
- }
-
- /** {@inheritDoc} */
- public Set> entrySet() {
- return getContent().entrySet();
- }
-
- /** {@inheritDoc} */
- public Object get(Object key) {
- if (toUpdate.containsKey(key)) return toUpdate.get(key);
- return getContent().get(key);
- }
-
- /**
- * Returns the Boolean value associated with the specified key. Values
- * can be converted from: 0, 1, true, false.
- *
- * @param key The key to look up.
- * @return The Boolean value associated with the specified key.
- */
- boolean getBoolean(String key) {
- if (toUpdate.containsKey(key))
- return Value.toBoolean(toUpdate.get(key).toString());
- return getContent().getBoolean(key);
- }
-
- /**
- * Returns the Boolean value associated with the specified key, or the
- * default value if the key does not exist. Boolean values can be converted
- * from: 0, 1, true, false.
- *
- * @param key The key to look up.
- * @param defaultValue The default value.
- * @return The Boolean value associated with the specified key.
- */
- boolean getBoolean(String key, boolean defaultValue) {
- if (toUpdate.containsKey(key))
- return Value.toBoolean(toUpdate.get(key).toString());
- return getContent().getBoolean(key, defaultValue);
- }
-
- /**
- * Returns the long value associated with the specified key. Long values
- * can be converted from: number, numberMB, numberGB.
- *
- * @param key The key to look up.
- * @return The long value associated with the specified key.
- */
- long getByteCount(String key) {
- if (toUpdate.containsKey(key))
- return Value.toByteCount(toUpdate.get(key).toString());
- return getContent().getByteCount(key);
- }
-
- /**
- * Returns the long value associated with the specified key, or the default
- * value if the key does not exist. Long values can be converted from:
- * number, numberMB, numberGB.
- *
- * @param key The key to look up.
- * @param defaultValue The default value.
- * @return The long value associated with the specified key.
- */
- long getByteCount(String key, long defaultValue) {
- if (toUpdate.containsKey(key))
- return Value.toByteCount(toUpdate.get(key).toString());
- return getContent().getByteCount(key, defaultValue);
- }
-
- protected Record getContent() {
- return validate().content;
- }
-
- /**
- * Returns a date value associated with the specified key. Date values can
- * be converted from standard UTC time formats.
- *
- * @param key The key to look up.
- * @return The date value associated with the specified key.
- */
- Date getDate(String key) {
- if (toUpdate.containsKey(key))
- return Value.toDate(toUpdate.get(key).toString());
- if (getContent().containsKey(key)) {
- return getContent().getDate(key);
- } else {
- return null;
- }
- }
-
- /**
- * Returns a date value associated with the specified key, or the default
- * value if the key does not exist. Date values can be converted from
- * standard UTC time formats.
- *
- * @param key The key to look up.
- * @param defaultValue The default value.
- * @return The date value associated with the specified key.
- */
- Date getDate(String key, Date defaultValue) {
- if (toUpdate.containsKey(key))
- return Value.toDate(toUpdate.get(key).toString());
- return getContent().getDate(key, defaultValue);
- }
-
- /**
- * Returns the floating point value associated with the specified key.
- *
- * @param key The key to look up.
- * @return The floating point value associated with the specified key.
- */
- float getFloat(String key) {
- if (toUpdate.containsKey(key))
- return Value.toFloat(toUpdate.get(key).toString());
- return getContent().getFloat(key);
- }
-
- /**
- * Returns the integer point value associated with the specified key.
- *
- * @param key The key to look up.
- * @return The integer point value associated with the specified key.
- */
- int getInteger(String key) {
- if (toUpdate.containsKey(key))
- return Value.toInteger(toUpdate.get(key).toString());
- return getContent().getInteger(key);
- }
-
- /**
- * Returns the integer value associated with the specified key.
- *
- * @param key The key to look up.
- * @param defaultValue The default value.
- * @return The integer value associated with the specified key.
- */
- int getInteger(String key, int defaultValue) {
- if (toUpdate.containsKey(key))
- return Value.toInteger(toUpdate.get(key).toString());
- return getContent().getInteger(key, defaultValue);
- }
-
- /**
- * Returns the long value associated with the specified key.
- *
- * @param key The key to look up.
- * @return The long value associated with the specified key.
- */
- long getLong(String key) {
- if (toUpdate.containsKey(key))
- return Value.toLong(toUpdate.get(key).toString());
- return getContent().getLong(key);
- }
-
- /**
- * Returns the long value associated with the specified key.
- *
- * @param key The key to look up.
- * @param defaultValue The default value.
- * @return The long value associated with the specified key.
- */
- long getLong(String key, int defaultValue) {
- if (toUpdate.containsKey(key))
- return Value.toLong(toUpdate.get(key).toString());
- return getContent().getLong(key, defaultValue);
- }
-
- /**
- * Returns the metadata (eai:acl) of this entity. This data includes
- * permissions for accessing the resource, and values that indicate
- * which resource fields are wildcards, required, and optional.
- *
- * @return The metadata of this entity, or {@code null} if none exist.
- */
- public EntityMetadata getMetadata() {
- // CONSIDER: For entities that don't have an eai:acl field, which is
- // uncommon but does happen at least in the case of a DeploymentClient
- // that is not enabled, we return null. A slightly friendlier option
- // would be to return a metadata instance that defaults all values?
- if (!containsKey("eai:acl")) return null;
- return new EntityMetadata(this);
- }
-
- /**
- * Returns the string value associated with the specified key.
- *
- * @param key The key to look up.
- * @return The string value associated with the specified key.
- */
- String getString(String key) {
- if (toUpdate.containsKey(key))
- return toUpdate.get(key).toString();
- return getContent().getString(key);
- }
-
- /**
- * Returns the string value associated with the specified key, or the
- * default value if the key does not exist.
- *
- * @param key The key to look up.
- * @param defaultValue The default value.
- * @return The string value associated with the specified key.
- */
- String getString(String key, String defaultValue) {
- if (toUpdate.containsKey(key))
- return toUpdate.get(key).toString();
- return getContent().getString(key, defaultValue);
- }
-
- /**
- * Returns the string array value associated with the specified key.
- *
- * @param key The key to look up.
- * @return The string array value associated with the specified key.
- */
- String[] getStringArray(String key) {
- if (toUpdate.containsKey(key)) {
- return ((String)toUpdate.get(key)).split("\\|");
- }
- return getContent().getStringArray(key);
- }
-
- /**
- * Returns the string array value associated with the specified key, or the
- * default value if the key does not exist.
- *
- * @param key The key to look up.
- * @param defaultValue The default value.
- * @return The string array value associated with the specified key.
- */
- String[] getStringArray(String key, String[] defaultValue) {
- if (toUpdate.containsKey(key))
- return getStringArray(key);
- return getContent().getStringArray(key, defaultValue);
- }
-
- /** {@inheritDoc} */
- public boolean isEmpty() {
- return getContent().isEmpty();
- }
-
- /**
- * Indicates whether this entity is disabled. This method is
- * available on almost every endpoint.
- *
- * @return {@code true} if this entity is disabled, {@code false} if
- * enabled.
- */
- public boolean isDisabled() {
- return getBoolean("disabled", false);
- }
-
- /**
- * Returns whether this entity's name can be changed via {@link #update}.
- *
- * Most entity names cannot be changed in this way.
- * @return false.
- */
- protected boolean isNameChangeAllowed() {
- return false;
- }
-
- /** {@inheritDoc} */
- public Set keySet() {
- return getContent().keySet();
- }
-
- @Override
- Entity load(AtomObject value) {
- super.load(value);
- AtomEntry entry = (AtomEntry)value;
- if (entry == null) {
- content = new Record();
- }
- else {
- content = entry.content;
- }
- return this;
- }
-
- /** {@inheritDoc} */
- public Object put(String key, Object value) {
- throw new UnsupportedOperationException();
- }
-
- /** {@inheritDoc} */
- public void putAll(Map extends String, ? extends Object> map) {
- throw new UnsupportedOperationException();
- }
-
- /** {@inheritDoc} */
- @Override public Entity refresh() {
- // Update any attribute values set by a setter method that has not
- // yet been written to the object.
- ResponseMessage response = service.get(path);
- assert(response.getStatus() == 200);
- AtomFeed feed;
- try {
- feed = AtomFeed.parseStream(response.getContent());
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- int count = feed.entries.size();
- if (count > 1) {
- throw new IllegalStateException("Expected 0 or 1 Atom entries; found " + feed.entries.size());
- }
- AtomEntry entry = count == 0 ? null : feed.entries.get(0);
- load(entry);
- return this;
- }
-
- /** {@inheritDoc} */
- public Object remove(Object key) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Sets the local cache update value. Writing is deferred until
- * {@code update} has been called.
- *
- * @param key The key to set.
- * @param value The default value.
- */
- void setCacheValue(String key, Object value) {
- toUpdate.put(key, value);
- }
-
- /** {@inheritDoc} */
- public int size() {
- return getContent().size();
- }
-
- /**
- * Updates the entity with the values you previously set using the setter
- * methods, and any additional specified arguments. The specified arguments
- * take precedent over the values that were set using the setter methods.
- *
- * @param args The arguments to update.
- */
- public void update(Map args) {
- if (!toUpdate.isEmpty() || !args.isEmpty()) {
- // Merge cached setters and live args together before updating.
- Map mergedArgs =
- new LinkedHashMap();
- mergedArgs.putAll(toUpdate);
- mergedArgs.putAll(args);
-
- if (mergedArgs.containsKey("name") && !isNameChangeAllowed()) {
- throw new IllegalStateException("Cannot set 'name' on an existing entity.");
- }
-
- service.post(actionPath("edit"), mergedArgs);
- toUpdate.clear();
- invalidate();
- }
- }
-
- /**
- * Updates the entity with the accumulated arguments, established by the
- * individual setter methods for each specific entity class.
- */
- @SuppressWarnings("unchecked")
- public void update() {
- update(Collections.EMPTY_MAP);
- }
-
-
- /**
- * Update the access control list (ACL) properties for this entity,
- *
- * @param args: Properties to update for this entity.
- * Required Properties in 'args'
- * - `owner`: The Splunk username, such as "admin". A value of "nobody" means no specific user.
- * - `sharing`: A mode that indicates how the resource is shared. The sharing mode can be "user", "app", "global", or "system".
- */
- public void aclUpdate(Map args){
- if(!args.containsKey("sharing")){
- throw new IllegalArgumentException("Required argument 'sharing' is missing.");
- }
- if(!args.containsKey("owner")){
- throw new IllegalArgumentException("Required argument 'owner' is missing.");
- }
- service.post(actionPath("acl"), args);
- invalidate();
- }
-
- /**
- * Removes this entity from its corresponding collection.
- */
- public void remove() {
- service.delete(actionPath("remove"));
- }
-
- /** {@inheritDoc} */
- @Override public Entity validate() {
- super.validate();
- return this;
- }
-
- /** {@inheritDoc} */
- public Collection