Examples of MessageBoxException


Examples of org.wso2.carbon.messagebox.MessageBoxException

        try {
            UserRegistry userRegistry = Utils.getUserRegistry();
            userRegistry.delete(messageBoxResourcePath);
            userRegistry.delete(MessageBoxConstants.MB_QUEUE_STORAGE_PATH + "/" + messageBoxID.replaceFirst("/", "."));
        } catch (RegistryException e) {
            throw new MessageBoxException("Can not access the registry", e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.messagebox.MessageBoxException

            permissionResource.addProperty(MessageBoxConstants.MB_REGISTRY_PROPERTY_OPERATIONS,
                                           operationsString.toString());

            userRegistry.put(permissionLabelResourcePath, permissionResource);
        } catch (RegistryException e) {
            throw new MessageBoxException("Can not access the registry", e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.messagebox.MessageBoxException

        String permissionLabelResourcePath = getMessageBoxResourcePath(messageBoxId) + "/" + permissionLabel;
        try {
            UserRegistry userRegistry = Utils.getUserRegistry();
            userRegistry.delete(permissionLabelResourcePath);
        } catch (RegistryException e) {
            throw new MessageBoxException("Can not access the registry", e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.messagebox.MessageBoxException

                                                      Arrays.asList(operations));
                permissionList.add(permissionLabel);
            }
            return permissionList;
        } catch (RegistryException e) {
            throw new MessageBoxException("Can not find resources in the registry", e);
        }

    }
View Full Code Here

Examples of org.wso2.carbon.messagebox.MessageBoxException

                    "\\" + MessageBoxConstants.JMS_MESSAGE_SHARED_USER_OPERATION_SEPARATOR);

            return new PermissionLabel(permissionLabel, Arrays.asList(sharedUsers),
                                       Arrays.asList(operations));
        } catch (RegistryException e) {
            throw new MessageBoxException("Can not find the resource in " + permissionLabelResourcePath, e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.messagebox.MessageBoxException

                    return userCollection.getProperty(accessKeyId);
                }
            }
            return null;
        } catch (org.wso2.carbon.registry.api.RegistryException e) {
            throw new MessageBoxException("Failed to get secret id of user " + accessKeyId);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.messagebox.MessageBoxException

                    this.queueAttributes.put(attributeName, attributeValue);
                } else {
                    if (log.isWarnEnabled()) {
                        log.warn(attributeName + " attribute value can not be null.");
                    }
                    throw new MessageBoxException( "InvalidAttributeValue ", "Unknown attributeValue ");
                }
            } else {
                if (log.isWarnEnabled()) {
                    log.warn(attributeName + " attribute is not supported.");
                }
                throw new MessageBoxException("InvalidAttributeName ", "Unknown attribute ");
            }
        }
    }
View Full Code Here

Examples of org.wso2.carbon.messagebox.MessageBoxException

        String username = getCurrentUser();
        if (!(Utils.isAdmin(username) || isMessageBoxOwner(messageBoxId, username) ||
              authorizationHandler.isUserAuthorized(username,
                                                    messageBoxId,
                                                    MessageBoxConstants.SQS_OPERATION_RECEIVE_MESSAGE))) {
            throw new MessageBoxException("AccessDenied");
        }

        if (!registryMessageBoxHandler.isMessageBoxExists(messageBoxId)) {
            throw new MessageBoxException("AWS.SimpleQueueService.NonExistentQueue");
        }

        try {
            List<Message> jmsMessageList = JMSQueueHandler.browse(messageBoxId);

            MessageDetails[] messageDetailsArray = new MessageDetails[jmsMessageList.size()];
            int index = 0;
            for (Message jmsMessage : jmsMessageList) {
                messageDetailsArray[index++] = jmsMessageToMessageDetails(jmsMessage);
            }

            return messageDetailsArray;
        } catch (JMSQueueHandlerException e) {
            throw new MessageBoxException("InternalError", e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.messagebox.MessageBoxException

        String username = getCurrentUser();
        if (!(Utils.isAdmin(username) || isMessageBoxOwner(messageBoxId, username) ||
              authorizationHandler.isUserAuthorized(username,
                                                    messageBoxId,
                                                    MessageBoxConstants.SQS_OPERATION_RECEIVE_MESSAGE))) {
            throw new MessageBoxException("AccessDenied");
        }

        if (!registryMessageBoxHandler.isMessageBoxExists(messageBoxId)) {
            throw new MessageBoxException("AWS.SimpleQueueService.NonExistentQueue");
        }

        List<MessageDetails> messageDetailsList = new ArrayList<MessageDetails>();
        MessageDetails messageDetails;
        for (MessageLock messageLock : getMessageLocks().values()) {
View Full Code Here

Examples of org.wso2.carbon.messagebox.MessageBoxException

        String username = getCurrentUser();
        if (!(Utils.isAdmin(username) || isMessageBoxOwner(messageBoxId, username) ||
              authorizationHandler.isUserAuthorized(username,
                                                    messageBoxId,
                                                    MessageBoxConstants.SQS_OPERATION_RECEIVE_MESSAGE))) {
            throw new MessageBoxException("AccessDenied");
        }
        return registryMessageBoxHandler.getAllPermissions(messageBoxId);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.