Search in sources :

Example 1 with LocalOozieClientBundle

use of org.apache.oozie.LocalOozieClientBundle in project oozie by apache.

the class LocalOozie method getClientBundle.

/**
 * <p>
 * The returned instance is configured with the user name of the JVM (the
 * value of the system property 'user.name').
 * <p>
 * The following methods of the client are NOP in the returned instance:
 * {@link org.apache.oozie.client.OozieClient#validateWSVersion},
 * {@link org.apache.oozie.client.OozieClient#setHeader},
 * {@link org.apache.oozie.client.OozieClient#getHeader},
 * {@link org.apache.oozie.client.OozieClient#removeHeader},
 * {@link org.apache.oozie.client.OozieClient#getHeaderNames},
 * {@link org.apache.oozie.client.OozieClient#setSystemMode(OozieClient.SYSTEM_MODE)},
 * {@link org.apache.oozie.client.OozieClient#getHeaders},
 * {@link org.apache.oozie.client.OozieClient#getClientBuildVersion}.
 *
 * @return a {@link org.apache.oozie.client.OozieClient} for LocalOozie.
 */
public static OozieClient getClientBundle(String user) {
    if (!localOozieActive) {
        throw new IllegalStateException("LocalOozie is not initialized");
    }
    ParamChecker.notEmpty(user, "user");
    BundleEngine bundleEngine = Services.get().get(BundleEngineService.class).getBundleEngine(user);
    return new LocalOozieClientBundle(bundleEngine);
}
Also used : LocalOozieClientBundle(org.apache.oozie.LocalOozieClientBundle) BundleEngineService(org.apache.oozie.service.BundleEngineService) BundleEngine(org.apache.oozie.BundleEngine)

Aggregations

BundleEngine (org.apache.oozie.BundleEngine)1 LocalOozieClientBundle (org.apache.oozie.LocalOozieClientBundle)1 BundleEngineService (org.apache.oozie.service.BundleEngineService)1