本文整理汇总了Java中org.wso2.carbon.CarbonConstants.REGISTRY_SYSTEM_USERNAME属性的典型用法代码示例。如果您正苦于以下问题:Java CarbonConstants.REGISTRY_SYSTEM_USERNAME属性的具体用法?Java CarbonConstants.REGISTRY_SYSTEM_USERNAME怎么用?Java CarbonConstants.REGISTRY_SYSTEM_USERNAME使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.wso2.carbon.CarbonConstants
的用法示例。
在下文中一共展示了CarbonConstants.REGISTRY_SYSTEM_USERNAME属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doPostRemoveBPSPackage
/**
* Trigger after deleting a BPS package
*
* @param workflow
* @throws WorkflowImplException
*/
@Override
public void doPostRemoveBPSPackage(Workflow workflow) throws WorkflowImplException {
String loggedInUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (StringUtils.isBlank(loggedInUser)) {
loggedInUser = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
String auditData = "\"" + "Workflow Name" + "\" : \"" + workflow.getWorkflowName()
+ "\",\"" + "Template ID" + "\" : \"" + workflow.getTemplateId()
+ "\",\"" + "Workflow Description" + "\" : \"" + workflow.getWorkflowDescription()
+ "\",\"" + "Workflow ID" + "\" : \"" + workflow.getWorkflowId()
+ "\",\"" + "Workflow Impl ID" + "\" : \"" + workflow.getWorkflowImplId()
+ "\"";
AUDIT_LOG.info(String.format(AUDIT_MESSAGE, loggedInUser, "Remove BPS Package",
"Workflow Impl Admin Service", auditData, AUDIT_SUCCESS));
}
示例2: getUser
private String getUser() {
String user = CarbonContext.getThreadLocalCarbonContext().getUsername();
if (user != null) {
user = user + "@" + CarbonContext.getThreadLocalCarbonContext().getTenantDomain();
} else {
user = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
return user;
}
示例3: doPostDeleteWorkflowRequest
/**
* Trigger after deleting the request
*
* @param workflowRequest
* @throws WorkflowException
*/
@Override
public void doPostDeleteWorkflowRequest(WorkflowRequest workflowRequest) throws WorkflowException {
String loggedInUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (StringUtils.isBlank(loggedInUser)) {
loggedInUser = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
String auditData = "\"" + "Request ID" + "\" : \"" + workflowRequest.getRequestId() + "\"";
AUDIT_LOG.info(String.format(AUDIT_MESSAGE, loggedInUser, "Remove workflow request", auditData,
AUDIT_SUCCESS));
}
示例4: doPostDeleteWorkflow
/**
* Trigger after delete the workflow
*
* @param workflow
* @throws WorkflowException
*/
@Override
public void doPostDeleteWorkflow(Workflow workflow) throws WorkflowException {
String loggedInUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (StringUtils.isBlank(loggedInUser)) {
loggedInUser = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
String auditData = "\"" + "Workflow ID" + "\" : \"" + workflow.getWorkflowId() + "\"";
AUDIT_LOG.info(String.format(AUDIT_MESSAGE, loggedInUser, "Remove workflow", auditData, AUDIT_SUCCESS));
}
示例5: doPostAddWorkflow
/**
* Trigger after adding a workflow
*
* @param workflowDTO
* @param parameterList
* @param tenantId
* @throws WorkflowException
*/
@Override
public void doPostAddWorkflow(Workflow workflowDTO, List<Parameter> parameterList, int tenantId) throws
WorkflowException {
String loggedInUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (StringUtils.isBlank(loggedInUser)) {
loggedInUser = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
String auditData = "\"" + "Workflow Name" + "\" : \"" + workflowDTO.getWorkflowName() + "\",\""
+ "Workflow Impl ID" + "\" : \"" + workflowDTO.getWorkflowImplId() + "\",\""
+ "Workflow ID" + "\" : \"" + workflowDTO.getWorkflowId() + "\",\""
+ "Workflow Description" + "\" : \"" + workflowDTO.getWorkflowDescription() + "\",\""
+ "Template ID" + "\" : \"" + workflowDTO.getTemplateId() + "\"";
AUDIT_LOG.info(String.format(AUDIT_MESSAGE, loggedInUser, "Add Workflow", auditData, AUDIT_SUCCESS));
}
示例6: doPostAddAssociation
/**
* Trigger after adding a association
*
* @param associationName
* @param workflowId
* @param eventId
* @param condition
* @throws WorkflowException
*/
@Override
public void doPostAddAssociation(String associationName, String workflowId, String eventId, String condition)
throws WorkflowException {
String loggedInUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (StringUtils.isBlank(loggedInUser)) {
loggedInUser = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
String auditData = "\"" + "Association Name" + "\" : \"" + associationName+ "\",\""
+ "Workflow ID" + "\" : \"" + workflowId + "\",\""
+ "Event ID" + "\" : \"" + eventId + "\",\""
+ "Condition" + "\" : \"" + condition + "\"";
AUDIT_LOG.info(String.format(AUDIT_MESSAGE, loggedInUser, "Add Association", auditData, AUDIT_SUCCESS));
}
示例7: doPostRemoveAssociation
/**
* Trigger after removing an association.
*
* @param associationId
* @throws WorkflowException
*/
@Override
public void doPostRemoveAssociation(int associationId) throws WorkflowException {
String loggedInUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (StringUtils.isBlank(loggedInUser)) {
loggedInUser = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
String auditData = "\"" + "Association ID" + "\" : \"" + associationId + "\"";
AUDIT_LOG.info(String.format(AUDIT_MESSAGE, loggedInUser, "Remove Association", auditData, AUDIT_SUCCESS));
}
示例8: doPostChangeAssociationState
/**
* Trigger after changing state of an association
*
* @param associationId
* @param isEnable
* @throws WorkflowException
*/
@Override
public void doPostChangeAssociationState(String associationId, boolean isEnable) throws WorkflowException {
String loggedInUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (StringUtils.isBlank(loggedInUser)) {
loggedInUser = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
String auditData = "\"" + "Association ID" + "\" : \"" + associationId + "\",\""
+ "Resulting State" + "\" : \"" + isEnable + "\"";
AUDIT_LOG.info(String.format(AUDIT_MESSAGE, loggedInUser, "Change Association State", auditData,
AUDIT_SUCCESS));
}
示例9: doPostExecuteWorkflow
/**
* Trigger after executing a workflow request
*
* @param workFlowRequest
* @throws WorkflowException
*/
@Override
public void doPostExecuteWorkflow(WorkflowRequest workFlowRequest, WorkflowExecutorResult result) throws
WorkflowException {
String loggedInUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (StringUtils.isBlank(loggedInUser)) {
loggedInUser = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
String auditData = "\"" + "Operation Type" + "\" : \"" + workFlowRequest.getEventType()
+ "\",\"" + "Request parameters" + "\" : \"" + workFlowRequest.getRequestParameterAsString()
+ "\"";
AUDIT_LOG.info(String.format(AUDIT_MESSAGE, loggedInUser, "Initiate Workflow", auditData,
AUDIT_SUCCESS));
}
示例10: doPostHandleCallback
/**
* Trigger after handling a callback
*
* @param uuid
* @param status
* @param additionalParams
* @throws WorkflowException
*/
@Override
public void doPostHandleCallback(String uuid, String status, Map<String, Object> additionalParams) throws WorkflowException {
String loggedInUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (StringUtils.isBlank(loggedInUser)) {
loggedInUser = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
String auditData = "\"" + "Request ID" + "\" : \"" + uuid
+ "\",\"" + "Callback Status" + "\" : \"" + status
+ "\"";
AUDIT_LOG.info(String.format(AUDIT_MESSAGE, loggedInUser, "Callback for Workflow Request", auditData,
AUDIT_SUCCESS));
}
示例11: publish
public void publish(Message message, String topicName, int deliveryMode) throws EventBrokerException {
String resoucePath = JavaUtil.getResourcePath(topicName, this.topicStoragePath);
try {
UserRealm userRealm =
EventBrokerHolder.getInstance().getRealmService().getTenantUserRealm
(CarbonContext.getThreadLocalCarbonContext().getTenantId());
String userName = CarbonContext.getThreadLocalCarbonContext().getUsername();
if (userName == null){
userName = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
if (userName.equals(CarbonConstants.REGISTRY_SYSTEM_USERNAME) ||
userRealm.getAuthorizationManager().isUserAuthorized(
userName,
resoucePath,
EventBrokerConstants.EB_PERMISSION_PUBLISH)) {
List<Subscription> subscriptions = this.matchingManager.getMatchingSubscriptions(topicName);
for (Subscription subscription : subscriptions) {
this.executor.submit(new Worker(this.notificationManager, message, subscription));
}
} else {
throw new EventBrokerException("User " + CarbonContext.getThreadLocalCarbonContext().getUsername()
+ " is not allowed to publish to " + topicName);
}
} catch (UserStoreException e) {
throw new EventBrokerException("Can not access the user store manager");
}
}
示例12: doPostAddBPSProfile
/**
* Trigger after adding new BPS profile
*
* @param bpsProfileDTO
* @param tenantId
* @throws WorkflowImplException
*/
@Override
public void doPostAddBPSProfile(BPSProfile bpsProfileDTO, int tenantId) throws WorkflowImplException {
String loggedInUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (StringUtils.isBlank(loggedInUser)) {
loggedInUser = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
String auditData = "\"" + "Profile Name" + "\" : \"" + bpsProfileDTO.getProfileName()
+ "\",\"" + "Manager Host URL" + "\" : \"" + bpsProfileDTO.getManagerHostURL()
+ "\",\"" + "Worker Host URL" + "\" : \"" + bpsProfileDTO.getWorkerHostURL()
+ "\",\"" + "User" + "\" : \"" + bpsProfileDTO.getUsername()
+ "\"";
AUDIT_LOG.info(String.format(AUDIT_MESSAGE, loggedInUser, "Add BPS Profile", auditData, AUDIT_SUCCESS));
}
示例13: doPostRemoveBPSProfile
/**
* Trigger after removing a BPS profile
*
* @param profileName
* @throws WorkflowImplException
*/
@Override
public void doPostRemoveBPSProfile(String profileName) throws WorkflowImplException {
String loggedInUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (StringUtils.isBlank(loggedInUser)) {
loggedInUser = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
String auditData = "\"" + "Profile Name" + "\" : \"" + profileName + "\"";
AUDIT_LOG.info(String.format(AUDIT_MESSAGE, loggedInUser, "Delete BPS Profile", auditData, AUDIT_SUCCESS));
}
示例14: doPostUpdateBPSProfile
/**
* Trigger after updating a BPS profile
*
* @param bpsProfileDTO
* @param tenantId
* @throws WorkflowImplException
*/
@Override
public void doPostUpdateBPSProfile(BPSProfile bpsProfileDTO, int tenantId) throws WorkflowImplException {
String loggedInUser = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (StringUtils.isBlank(loggedInUser)) {
loggedInUser = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
String auditData = "\"" + "Profile Name" + "\" : \"" + bpsProfileDTO.getProfileName()
+ "\",\"" + "Manager Host URL" + "\" : \"" + bpsProfileDTO.getManagerHostURL()
+ "\",\"" + "Worker Host URL" + "\" : \"" + bpsProfileDTO.getWorkerHostURL()
+ "\",\"" + "User" + "\" : \"" + bpsProfileDTO.getUsername()
+ "\"";
AUDIT_LOG.info(String.format(AUDIT_MESSAGE, loggedInUser, "Update BPS Profile", auditData, AUDIT_SUCCESS));
}
示例15: publish
public void publish(Message message, String topicName, int deliveryMode) throws EventBrokerException {
String resourcePath = JavaUtil.getResourcePath(topicName, this.topicStoragePath);
try {
UserRealm userRealm =
EventBrokerHolder.getInstance().getRealmService().getTenantUserRealm
(CarbonContext.getThreadLocalCarbonContext().getTenantId());
String userName = CarbonContext.getThreadLocalCarbonContext().getUsername();
if (userName == null){
userName = CarbonConstants.REGISTRY_SYSTEM_USERNAME;
}
if (userName.equals(CarbonConstants.REGISTRY_SYSTEM_USERNAME) ||
userRealm.getAuthorizationManager().isUserAuthorized(
userName,
resourcePath,
EventBrokerConstants.EB_PERMISSION_PUBLISH)) {
List<Subscription> subscriptions = getMatchingManager().getMatchingSubscriptions(topicName);
for (Subscription subscription : subscriptions) {
String verified = SharedMemorySubscriptionStorage
.getSubscriptionIDTopicNameCache().get(subscription.getId()+"-notVerfied");
if(verified != null && "false".equalsIgnoreCase(verified)){
subscription.addProperty("notVerfied", "false");
}
this.executor.submit(new Worker(this.notificationManager, message, subscription));
}
} else {
throw new EventBrokerException("User " + CarbonContext.getThreadLocalCarbonContext().getUsername()
+ " is not allowed to publish to " + topicName);
}
} catch (UserStoreException e) {
throw new EventBrokerException("Can not access the user store manager",e);
}
}