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;
}
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));
}
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());
}
}
Aggregations