Search in sources :

Example 11 with SchedulerException

use of org.ow2.proactive.scheduler.common.exception.SchedulerException in project scheduling by ow2-proactive.

the class SchedulerRMProxyFactory method connectToScheduler.

public SchedulerProxyUserInterface connectToScheduler(CredData credData) throws ActiveObjectCreationException, NodeException, LoginException, SchedulerException {
    SchedulerProxyUserInterface scheduler = PAActiveObject.newActive(SchedulerProxyUserInterface.class, new Object[] {});
    scheduler.init(PortalConfiguration.SCHEDULER_URL.getValueAsString(), credData);
    return scheduler;
}
Also used : SchedulerProxyUserInterface(org.ow2.proactive.scheduler.common.util.SchedulerProxyUserInterface)

Example 12 with SchedulerException

use of org.ow2.proactive.scheduler.common.exception.SchedulerException in project scheduling by ow2-proactive.

the class SchedulerRMProxyFactory method connectToScheduler.

public SchedulerProxyUserInterface connectToScheduler(Credentials credentials) throws LoginException, SchedulerException, ActiveObjectCreationException, NodeException {
    SchedulerProxyUserInterface scheduler = PAActiveObject.newActive(SchedulerProxyUserInterface.class, new Object[] {});
    scheduler.init(PortalConfiguration.SCHEDULER_URL.getValueAsString(), credentials);
    return scheduler;
}
Also used : SchedulerProxyUserInterface(org.ow2.proactive.scheduler.common.util.SchedulerProxyUserInterface)

Example 13 with SchedulerException

use of org.ow2.proactive.scheduler.common.exception.SchedulerException in project scheduling by ow2-proactive.

the class SmartProxyImpl method init.

@Override
public void init(ConnectionInfo connectionInfo) throws SchedulerException, LoginException {
    this.connectionInfo = connectionInfo;
    if (connectionInfo.getCredentialFile() != null) {
        try {
            Credentials credentials = Credentials.getCredentials(connectionInfo.getCredentialFile().getAbsolutePath());
            init(connectionInfo.getUrl(), credentials);
        } catch (KeyException e) {
            throw new LoginException(e.getMessage());
        }
    } else {
        CredData cred = new CredData(CredData.parseLogin(connectionInfo.getLogin()), CredData.parseDomain(connectionInfo.getLogin()), connectionInfo.getPassword());
        init(connectionInfo.getUrl(), cred);
    }
}
Also used : CredData(org.ow2.proactive.authentication.crypto.CredData) LoginException(javax.security.auth.login.LoginException) Credentials(org.ow2.proactive.authentication.crypto.Credentials) KeyException(java.security.KeyException)

Example 14 with SchedulerException

use of org.ow2.proactive.scheduler.common.exception.SchedulerException in project scheduling by ow2-proactive.

the class AbstractSchedulerUser method connectToScheduler.

public void connectToScheduler() throws SchedulerException, LoginException {
    SchedulerAuthenticationInterface auth = SchedulerConnection.join(this.schedulerURL);
    this.scheduler = auth.login(this.userCreds);
    this.defaultParameter = this.scheduler;
}
Also used : SchedulerAuthenticationInterface(org.ow2.proactive.scheduler.common.SchedulerAuthenticationInterface)

Example 15 with SchedulerException

use of org.ow2.proactive.scheduler.common.exception.SchedulerException in project scheduling by ow2-proactive.

the class AbstractSchedulerUser method registerListener.

public void registerListener(boolean getInitialState, boolean myEventsOnly, String listenerClazzName) throws SchedulerException, ProActiveException {
    try {
        if (this.scheduler == null)
            throw new IllegalStateException("The user is not connected to the Scheduler yet. " + "Consider calling the connectToScheduler() method first");
        SchedulerEventListener schedulerListener = createEventListener(listenerClazzName);
        logger.trace("Trying to expose the listener as a remote object");
        slExposer = new SchedulerListenerExposer(schedulerListener);
        SchedulerEventListener schedulerListenerRemoteRef = slExposer.createRemoteReference();
        logger.trace("Trying to register the listener to the Scheduler");
        // for the moment, listens only to the Jobs-related events
        SchedulerState initialState = scheduler.addEventListener(schedulerListenerRemoteRef, myEventsOnly, getInitialState, // job-related events
        SchedulerEvent.JOB_SUBMITTED, SchedulerEvent.JOB_PENDING_TO_RUNNING, SchedulerEvent.JOB_PENDING_TO_FINISHED, SchedulerEvent.JOB_RUNNING_TO_FINISHED, SchedulerEvent.JOB_PAUSED, SchedulerEvent.JOB_RESUMED, SchedulerEvent.JOB_RESTARTED_FROM_ERROR, SchedulerEvent.JOB_CHANGE_PRIORITY, // task-related events
        SchedulerEvent.TASK_PENDING_TO_RUNNING, SchedulerEvent.TASK_RUNNING_TO_FINISHED, SchedulerEvent.TASK_WAITING_FOR_RESTART, SchedulerEvent.USERS_UPDATE, // Scheduler state related events
        SchedulerEvent.FROZEN, SchedulerEvent.RESUMED, SchedulerEvent.SHUTDOWN, SchedulerEvent.SHUTTING_DOWN, SchedulerEvent.STARTED, SchedulerEvent.STOPPED, SchedulerEvent.KILLED);
        if (getInitialState) {
            logger.info("Initial state of the scheduler is: " + initialState);
        }
    } catch (ClassNotFoundException e) {
        throw new IllegalArgumentException("Class " + listenerClazzName + " is not available on this SchedulerUser's side", e);
    } catch (InstantiationException e) {
        throw new IllegalArgumentException("Cannot instantiate listener of type " + listenerClazzName, e);
    } catch (IllegalAccessException e) {
        throw new IllegalArgumentException("Cannot instantiate listener of type " + listenerClazzName, e);
    }
}
Also used : SchedulerListenerExposer(scalabilityTests.framework.listeners.SchedulerListenerExposer) SchedulerState(org.ow2.proactive.scheduler.common.SchedulerState) SchedulerEventListener(org.ow2.proactive.scheduler.common.SchedulerEventListener)

Aggregations

CredData (org.ow2.proactive.authentication.crypto.CredData)7 SchedulerAuthenticationInterface (org.ow2.proactive.scheduler.common.SchedulerAuthenticationInterface)5 KeyException (java.security.KeyException)4 LoginException (javax.security.auth.login.LoginException)4 Credentials (org.ow2.proactive.authentication.crypto.Credentials)4 InternalSchedulerException (org.ow2.proactive.scheduler.common.exception.InternalSchedulerException)4 SchedulerException (org.ow2.proactive.scheduler.common.exception.SchedulerException)4 SchedulerProxyUserInterface (org.ow2.proactive.scheduler.common.util.SchedulerProxyUserInterface)3 PublicKey (java.security.PublicKey)2 HttpSession (javax.servlet.http.HttpSession)2 Consumes (javax.ws.rs.Consumes)2 POST (javax.ws.rs.POST)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 ActiveObjectCreationException (org.objectweb.proactive.ActiveObjectCreationException)2 NodeException (org.objectweb.proactive.core.node.NodeException)2 SchedulerState (org.ow2.proactive.scheduler.common.SchedulerState)2 JobId (org.ow2.proactive.scheduler.common.job.JobId)2 MBeanInfoViewer (org.ow2.proactive.utils.console.MBeanInfoViewer)2 Session (org.ow2.proactive_grid_cloud_portal.common.Session)2