Search in sources :

Example 1 with MBeanInfoViewer

use of org.ow2.proactive.utils.console.MBeanInfoViewer in project scheduling by ow2-proactive.

the class SchedulerProxyUserInterface method init.

/**
 * initialize the connection the scheduler.
 * Must be called only once.
 * Create the corresponding credential object before sending it
 * to the scheduler.
 * @param url the scheduler's url
 * @param credData the credential object that contains user-related data
 * @throws SchedulerException thrown if the scheduler is not available
 * @throws LoginException if the couple username/password is invalid
 * @since Scheduling 3.1.0
 */
public void init(String url, CredData credData) throws SchedulerException, LoginException {
    SchedulerAuthenticationInterface auth = SchedulerConnection.join(url);
    PublicKey pubKey = auth.getPublicKey();
    try {
        Credentials cred = Credentials.createCredentials(credData, pubKey);
        this.uischeduler = auth.login(cred);
        mbeaninfoviewer = new MBeanInfoViewer(auth, credData.getLogin(), cred);
    } catch (KeyException e) {
        throw new InternalSchedulerException(e);
    }
}
Also used : InternalSchedulerException(org.ow2.proactive.scheduler.common.exception.InternalSchedulerException) MBeanInfoViewer(org.ow2.proactive.utils.console.MBeanInfoViewer) PublicKey(java.security.PublicKey) SchedulerAuthenticationInterface(org.ow2.proactive.scheduler.common.SchedulerAuthenticationInterface) Credentials(org.ow2.proactive.authentication.crypto.Credentials) KeyException(java.security.KeyException)

Example 2 with MBeanInfoViewer

use of org.ow2.proactive.utils.console.MBeanInfoViewer in project scheduling by ow2-proactive.

the class SchedulerProxyUserInterface method init.

/**
 * initialize the connection the scheduler.
 * Must be called only once
 * @param url the scheduler's url
 * @param credentials the credential to be passed to the scheduler
 * @throws SchedulerException thrown if the scheduler is not available
 * @throws LoginException thrown if the credential is invalid
 */
public void init(String url, Credentials credentials) throws SchedulerException, LoginException {
    SchedulerAuthenticationInterface auth = SchedulerConnection.join(url);
    this.uischeduler = auth.login(credentials);
    mbeaninfoviewer = new MBeanInfoViewer(auth, null, credentials);
}
Also used : MBeanInfoViewer(org.ow2.proactive.utils.console.MBeanInfoViewer) SchedulerAuthenticationInterface(org.ow2.proactive.scheduler.common.SchedulerAuthenticationInterface)

Aggregations

SchedulerAuthenticationInterface (org.ow2.proactive.scheduler.common.SchedulerAuthenticationInterface)2 MBeanInfoViewer (org.ow2.proactive.utils.console.MBeanInfoViewer)2 KeyException (java.security.KeyException)1 PublicKey (java.security.PublicKey)1 Credentials (org.ow2.proactive.authentication.crypto.Credentials)1 InternalSchedulerException (org.ow2.proactive.scheduler.common.exception.InternalSchedulerException)1