Package com.streamreduce.core.model

Examples of com.streamreduce.core.model.Account$Builder


    @Produces(MediaType.APPLICATION_JSON)
    public Response searchMessagesPassthrough(JSONObject query,
                                              @PathParam("resourceName") String resourceName,
                                              @Context UriInfo uriInfo) {
        try {
            Account currentAccount = securityService.getCurrentUser().getAccount();
            ImmutableMap<String, String> queryParameters = ImmutableMap.copyOf(flattenValues(uriInfo.getQueryParameters()));
            List<SobaMessage> sobaMessages = searchService.searchMessages(currentAccount, resourceName, queryParameters, query);

            boolean fullText = queryParameters.get("fullText") != null ? Boolean.valueOf(queryParameters.get("fullText")) : false;
View Full Code Here


        // create it if it doesn't exist
        // always create the system user first
        if (getUser(Constants.NODEABLE_SYSTEM_USERNAME) == null) {

            Account rootAccount = accountDAO.findByName(Constants.NODEABLE_SUPER_ACCOUNT_NAME);

            // create it if it doesn't exist, should only happen with a clean db
            if (rootAccount == null) {
                Account account = new Account.Builder()
                        .url("http://nodeable.com")
                        .description("Core Nodeable Account")
                        .name(Constants.NODEABLE_SUPER_ACCOUNT_NAME)
                        .build();
                rootAccount = userService.createAccount(account);
View Full Code Here

        if (!securityService.hasRole(Roles.ADMIN_ROLE)) {
            return error(ErrorMessages.APPLICATION_ACCESS_DENIED, Response.status(Response.Status.UNAUTHORIZED));
        }

        User user = securityService.getCurrentUser();
        Account account = user.getAccount();

        account.mergeWithJSON(json);

        userService.updateAccount(account);

        return Response
                .status(Response.Status.NO_CONTENT)
View Full Code Here

        SobaMessageResponseDTO responseDTO = SobaMessageResponseDTO.fromSobaMessage(sobaMessage);
        Assert.assertEquals(sender.getAccount().getId(),responseDTO.getSenderAccountId());
    }

    private Connection createValidSender() {
        Account account = new Account.Builder().name("ho").build();
        account.setId(new ObjectId());

        User user = new User.Builder().username("hey").account(account).build();
        user.setId(new ObjectId());

        Connection connection = new Connection.Builder()
View Full Code Here

            @ManagedOperationParameter(name = "accountObjectId", description = "The ID of the account to return."),
            @ManagedOperationParameter(name = "summary", description = "Returns summary results if true.")})
    public String getAccount(String accountObjectId, boolean summary)
            throws AccountNotFoundException {

        Account account = userService.getAccount(new ObjectId(accountObjectId));
        return toJSON(account, summary);
    }
View Full Code Here

            @ManagedOperationParameter(name = "enabledUsersOnly", description = "Only returns enabled users if true."),
            @ManagedOperationParameter(name = "summary", description = "Returns summary results if true.")})
    public String getUsers(String accountObjectId, boolean enabledUsersOnly, boolean summary)
            throws AccountNotFoundException {

        Account account = userService.getAccount(new ObjectId(accountObjectId));
        List<User> users;
        if (enabledUsersOnly) {
            users = userService.allEnabledUsersForAccount(account);
        }
        else {
View Full Code Here

        assertEquals(actual, expected);
    }

    private static User createTestUser() {
        Account account = new Account.Builder().name("tool").build();
        account.setId(new ObjectId());

        User user = new User.Builder()
                .username("maynard@toolband.com")
                .account(account)
                .password("trollolol")
View Full Code Here

    private Connection connection;
    AWSClient awsClient;

    @Before
    public void setUp() throws Exception {
        Account testAccount = new Account.Builder()
                .url("http://nodeable.com")
                .description("Nodeable Test Account")
                .name("Nodeable Testing")
                .build();
        User testUser = new User.Builder()
View Full Code Here

    private InventoryItem inventoryItem;
    private GitHubClient gitHubClient;

    @Before
    public void setUp() throws Exception {
        Account testAccount = new Account.Builder()
                .url("http://nodeable.com")
                .description("Nodeable Test Account")
                .name("Nodeable Testing")
                .build();
View Full Code Here

    @Before
    public void setUp() throws Exception {
        jiraProjectHostingProvider = (JiraProjectHostingProvider) connectionProviderFactory.connectionProviderFromId(
                ProviderIdConstants.JIRA_PROVIDER_ID);

        Account testAccount = new Account.Builder()
                .url("http://nodeable.com")
                .description("Nodeable Test Account")
                .name("Nodeable Testing")
                .build();
        User testUser = new User.Builder()
View Full Code Here

TOP

Related Classes of com.streamreduce.core.model.Account$Builder

Copyright © 2018 www.massapicom. 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.