Search in sources :

Example 1 with LoginAuthenticationExceptionException

use of org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException in project carbon-apimgt by wso2.

the class GlobalThrottleEngineClient method validateExecutionPlan.

/**
 * Checks the validity of a execution plan
 *
 * @param executionPlan
 * @return boolean
 */
public boolean validateExecutionPlan(String executionPlan) {
    ServiceClient serviceClient;
    Options options;
    String result = null;
    try {
        String sessionCookie = login();
        EventProcessorAdminServiceStub eventProcessorAdminServiceStub = getEventProcessorAdminServiceStub();
        serviceClient = eventProcessorAdminServiceStub._getServiceClient();
        options = serviceClient.getOptions();
        options.setManageSession(true);
        options.setProperty(HTTPConstants.COOKIE_STRING, sessionCookie);
        result = eventProcessorAdminServiceStub.validateExecutionPlan(executionPlan);
    } catch (RemoteException e) {
        return false;
    } catch (MalformedURLException e) {
        return false;
    } catch (LoginAuthenticationExceptionException e) {
        return false;
    }
    if ("success".equalsIgnoreCase(result)) {
        return true;
    }
    return false;
}
Also used : Options(org.apache.axis2.client.Options) MalformedURLException(java.net.MalformedURLException) ServiceClient(org.apache.axis2.client.ServiceClient) EventProcessorAdminServiceStub(org.wso2.carbon.event.processor.stub.EventProcessorAdminServiceStub) RemoteException(java.rmi.RemoteException) LoginAuthenticationExceptionException(org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException)

Example 2 with LoginAuthenticationExceptionException

use of org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException in project product-iots by wso2.

the class SampleInstallationTest method setup.

@BeforeClass(alwaysRun = true)
public void setup() throws XPathExpressionException, XMLStreamException, IOException, AutomationFrameworkException, LoginAuthenticationExceptionException {
    super.init();
    logViewerClient = new LogViewerClient(getBackendURL(), getSessionCookie(automationContext));
}
Also used : LogViewerClient(org.wso2.carbon.integration.common.admin.client.LogViewerClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with LoginAuthenticationExceptionException

use of org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException in project carbon-apimgt by wso2.

the class GlobalThrottleEngineClient method deleteExecutionPlan.

/**
 * This method will be used to delete single execution plan.
 * @param name execution plan name to be deleted.
 */
public void deleteExecutionPlan(String name) {
    ServiceClient serviceClient;
    Options options;
    String sessionID = null;
    try {
        sessionID = login();
    } catch (RemoteException e) {
        log.error("Error while connecting to login central policy management server" + e.getMessage());
    } catch (LoginAuthenticationExceptionException e) {
        log.error("Error while connecting to login central policy management server, " + "Check user name and password" + e.getMessage());
    } catch (MalformedURLException e) {
        log.error("Error while connecting to login central policy management server, check URL" + e.getMessage());
    }
    EventProcessorAdminServiceStub eventProcessorAdminServiceStub = null;
    try {
        eventProcessorAdminServiceStub = getEventProcessorAdminServiceStub();
        serviceClient = eventProcessorAdminServiceStub._getServiceClient();
        options = serviceClient.getOptions();
        options.setManageSession(true);
        options.setProperty(HTTPConstants.COOKIE_STRING, sessionID);
        eventProcessorAdminServiceStub.undeployActiveExecutionPlan(name);
    } catch (AxisFault axisFault) {
        log.error("Error while connecting to login central policy management server to delete " + "execution plan." + axisFault);
    } catch (RemoteException e) {
        log.error("Error while connecting to login central policy management server to delete " + "execution plan." + e.getMessage());
    }
}
Also used : AxisFault(org.apache.axis2.AxisFault) Options(org.apache.axis2.client.Options) MalformedURLException(java.net.MalformedURLException) ServiceClient(org.apache.axis2.client.ServiceClient) EventProcessorAdminServiceStub(org.wso2.carbon.event.processor.stub.EventProcessorAdminServiceStub) RemoteException(java.rmi.RemoteException) LoginAuthenticationExceptionException(org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException)

Aggregations

MalformedURLException (java.net.MalformedURLException)2 RemoteException (java.rmi.RemoteException)2 Options (org.apache.axis2.client.Options)2 ServiceClient (org.apache.axis2.client.ServiceClient)2 LoginAuthenticationExceptionException (org.wso2.carbon.authenticator.stub.LoginAuthenticationExceptionException)2 EventProcessorAdminServiceStub (org.wso2.carbon.event.processor.stub.EventProcessorAdminServiceStub)2 AxisFault (org.apache.axis2.AxisFault)1 BeforeClass (org.testng.annotations.BeforeClass)1 LogViewerClient (org.wso2.carbon.integration.common.admin.client.LogViewerClient)1