use of org.wso2.carbon.humantask.client.api.types in project carbon-business-process by wso2.
the class HumanTaskServiceComponent method registerMBeans.
/**
* to register all the MBeans.
*
* @throws Exception
* @throws MBeanRegistrationException
* @throws InstanceAlreadyExistsException
* @throws NotCompliantMBeanException
*/
public void registerMBeans() throws Exception, MBeanRegistrationException, InstanceAlreadyExistsException, NotCompliantMBeanException {
log.info("Registering HT related MBeans");
HTTaskStatusMonitor taskStatusMonitor = new HTTaskStatusMonitor();
DeployedTasks deployedTasks = new DeployedTasks();
MBeanRegistrar.registerMBean(taskStatusMonitor, "org.wso2.carbon.humantask.core.integration.jmx:type=HTTaskStatusMonitorMXBean");
MBeanRegistrar.registerMBean(deployedTasks, "org.wso2.carbon.humantask.core.integration.jmx:type=DeployedTasksMXBean");
log.info("MXBean for Human tasks registered successfully");
}
use of org.wso2.carbon.humantask.client.api.types in project carbon-business-process by wso2.
the class HTCoordinationDAOConnectionImpl method createCoordinatedTask.
/**
* @see org.wso2.carbon.bpel.b4p.coordination.dao.HTCoordinationDAOConnection#createCoordinatedTask(String,
* String, String, String)
*/
@Override
public HTProtocolHandlerDAO createCoordinatedTask(String messageID, String htProtocolHandlerURL, String processInstanceID, String taskID) {
HTProtocolHandlerDAO protocolHandlerDAO = new HTProtocolHandler();
protocolHandlerDAO.setMessageID(messageID);
protocolHandlerDAO.setProcessInstanceID(processInstanceID);
protocolHandlerDAO.setTaskID(taskID);
protocolHandlerDAO.setHumanTaskProtocolHandlerURL(htProtocolHandlerURL);
entityManager.persist(protocolHandlerDAO);
return protocolHandlerDAO;
}
use of org.wso2.carbon.humantask.client.api.types in project carbon-business-process by wso2.
the class HTCoordinationDAOConnectionImpl method createCoordinatedTask.
/**
* @see org.wso2.carbon.bpel.b4p.coordination.dao.HTCoordinationDAOConnection#createCoordinatedTask(String,
* String, String, String)
*/
@Override
public HTProtocolHandlerDAO createCoordinatedTask(String messageID, String htProtocolHandlerURL, String processInstanceID, String taskID) {
HTProtocolHandlerDAO protocolHandlerDAO = new HTProtocolHandler();
protocolHandlerDAO.setMessageID(messageID);
protocolHandlerDAO.setProcessInstanceID(processInstanceID);
protocolHandlerDAO.setTaskID(taskID);
protocolHandlerDAO.setHumanTaskProtocolHandlerURL(htProtocolHandlerURL);
entityManager.persist(protocolHandlerDAO);
return protocolHandlerDAO;
}
use of org.wso2.carbon.humantask.client.api.types in project carbon-business-process by wso2.
the class BPSUserIdentityManager method checkPassword.
@Override
public Boolean checkPassword(String userId, String password) {
String tenantDomain = MultitenantUtils.getTenantDomain(userId);
String tenantAwareUserName = MultitenantUtils.getTenantAwareUsername(userId);
String userNameWithTenantDomain = tenantAwareUserName + "@" + tenantDomain;
RealmService realmService = RegistryContext.getBaseInstance().getRealmService();
TenantManager mgr = realmService.getTenantManager();
int tenantId = 0;
try {
tenantId = mgr.getTenantId(tenantDomain);
} catch (UserStoreException e) {
throw new BPMNAuthenticationException("Identity exception thrown while getting tenant ID for user : " + userNameWithTenantDomain, e);
}
// tenantId == -1, means an invalid tenant.
if (tenantId == -1) {
if (log.isDebugEnabled()) {
log.debug("Basic authentication request with an invalid tenant : " + userNameWithTenantDomain);
}
return false;
}
org.wso2.carbon.user.api.UserStoreManager userStoreManager = null;
boolean authStatus = false;
try {
userStoreManager = realmService.getTenantUserRealm(tenantId).getUserStoreManager();
authStatus = userStoreManager.authenticate(tenantAwareUserName, password);
} catch (UserStoreException e) {
throw new BPMNAuthenticationException("User store exception thrown while authenticating user : " + userNameWithTenantDomain, e);
}
/* IdentityService identityService = BPMNOSGIService.getIdentityService();
authStatus = identityService.checkPassword(userName, password);*/
if (log.isDebugEnabled()) {
log.debug("Basic authentication request completed. " + "Username : " + userNameWithTenantDomain + ", Authentication State : " + authStatus);
}
return authStatus;
}
use of org.wso2.carbon.humantask.client.api.types in project carbon-business-process by wso2.
the class AttachmentMgtDAOBasicOperationsTest method createAttachment.
/**
* Creates an attachment stub bean which is consumable by the Back-End server interface
* {@link org.wso2.carbon.attachment.mgt.skeleton.AttachmentMgtServiceSkeletonInterface}
*
* @return an attachment stub bean which is consumable by the Back-End server interface
*/
private TAttachment createAttachment() {
dummyAttachment = new TAttachment();
dummyAttachment.setName("DummyName");
dummyAttachment.setContentType("DummyContentType");
dummyAttachment.setCreatedBy("DummyUser");
DataHandler handler = new DataHandler(new FileDataSource(new File("src" + File.separator + "test" + File.separator + "resources" + File.separator + "dbConfig.xml")));
dummyAttachment.setContent(handler);
return dummyAttachment;
}
Aggregations