Package com.box.boxjavalibv2

Examples of com.box.boxjavalibv2.BoxConnectionManagerBuilder$BoxConnectionManager


        }
    }

    @Test
    public void testUpdateMembership() throws Exception {
        final BoxGroup group = createGroup();

        try {
            final BoxGroupMembership membership = createMembership(group.getId());

            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.membershipId", membership.getId());
            // parameter type is com.box.boxjavalibv2.requests.requestobjects.BoxGroupMembershipRequestObject
            final BoxGroupMembershipRequestObject requestObject =
                    BoxGroupMembershipRequestObject.updateMembershipRequestObject(BoxGroupMembership.ROLE_ADMIN);
            headers.put("CamelBox.groupMembershipRequest", requestObject);

            BoxGroupMembership result = requestBodyAndHeaders("direct://UPDATEMEMBERSHIP", null, headers);

            assertNotNull("updateMembership result", result);
            LOG.debug("updateMembership: " + result);
        } finally {
            deleteGroup(group.getId());
        }
    }
View Full Code Here


        }
    }

    @Test
    public void testUpdateMembership1() throws Exception {
        final BoxGroup group = createGroup();

        try {
            final BoxGroupMembership membership = createMembership(group.getId());

            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.membershipId", membership.getId());
            // parameter type is String
            headers.put("CamelBox.role", BoxGroupMembership.ROLE_ADMIN);

            BoxGroupMembership result = requestBodyAndHeaders("direct://UPDATEMEMBERSHIP_1", null, headers);

            assertNotNull("updateMembership result", result);
            LOG.debug("updateMembership: " + result);
        } finally {
            deleteGroup(group.getId());
        }
    }
View Full Code Here

    public BoxGroupMembership createMembership(String groupId) throws Exception {
        // using com.box.boxjavalibv2.requests.requestobjects.BoxGroupMembershipRequestObject message body for single parameter "groupMembershipRequest"
        final BoxGroupMembershipRequestObject requestObject =
                BoxGroupMembershipRequestObject.addMembershipRequestObject(groupId, testUserId, BoxGroupMembership.ROLE_MEMBER);
        BoxGroupMembership result = requestBody("direct://CREATEMEMBERSHIP", requestObject);

        assertNotNull("createMembership result", result);
        return result;
    }
View Full Code Here

            // parameter type is String
            headers.put("CamelBox.userId", testUserId);
            // parameter type is String
            headers.put("CamelBox.role", BoxGroupMembership.ROLE_MEMBER);

            BoxGroupMembership result = requestBodyAndHeaders("direct://CREATEMEMBERSHIP_1", null, headers);

            assertNotNull("createMembership result", result);
            LOG.debug("createMembership: " + result);
        } finally {
            deleteGroup(group.getId());
View Full Code Here

    @Test
    public void testDeleteMembership() throws Exception {
        final BoxGroup group = createGroup();

        try {
            final BoxGroupMembership membership = createMembership(group.getId());

            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.membershipId", membership.getId());
            // parameter type is com.box.restclientv2.requestsbase.BoxDefaultRequestObject
//            headers.put("CamelBox.defaultRequest", null);
            requestBodyAndHeaders("direct://DELETEMEMBERSHIP", null, headers);
        } finally {
            deleteGroup(group.getId());
View Full Code Here

    @Test
    public void testGetMembership() throws Exception {
        final BoxGroup group = createGroup();

        try {
            final BoxGroupMembership membership = createMembership(group.getId());

            final Map<String, Object> headers = new HashMap<String, Object>();
            // parameter type is String
            headers.put("CamelBox.membershipId", membership.getId());
            // parameter type is com.box.restclientv2.requestsbase.BoxDefaultRequestObject
//            headers.put("CamelBox.defaultRequest", null);

            BoxGroupMembership result = requestBodyAndHeaders("direct://GETMEMBERSHIP", null, headers);

            assertNotNull("getMembership result", result);
            LOG.debug("getMembership: " + result);
        } finally {
            deleteGroup(group.getId());
View Full Code Here

    private static final String PATH_PREFIX = BoxApiCollection.getCollection().getApiName(IBoxSharedItemsManagerApiMethod.class).getName();

    @Test
    public void testGetSharedItem() throws Exception {
        // using com.box.restclientv2.requestsbase.BoxDefaultRequestObject message body for single parameter "defaultRequest"
        BoxItem result = requestBody("direct://GETSHAREDITEM", null);

        assertNotNull("getSharedItem result", result);
        LOG.debug("getSharedItem: " + result);
    }
View Full Code Here

                // get authorization code
                final String authorizationCode = params.get("code");

                // get OAuth token
                final IBoxOAuthManager oAuthManager = boxClient.getOAuthManager();
                final BoxOAuthToken oAuthToken = oAuthManager.createOAuth(authorizationCode,
                    configuration.getClientId(), configuration.getClientSecret(), null);

                // send initial token to BoxClient and this.listener
                final OAuthDataMessage authDataMessage = new OAuthDataMessage(oAuthToken,
                    boxClient.getJSONParser(), boxClient.getResourceHub());
View Full Code Here

                if (ObjectHelper.isEmpty(refreshToken)) {
                    return null;
                } else {
                    Map<String, Object> values = new HashMap<String, Object>();
                    values.put(BoxOAuthToken.FIELD_REFRESH_TOKEN, refreshToken);
                    return new BoxOAuthToken(values);
                }
            }
        });
        configuration.setRefreshListener(new OAuthRefreshListener() {
            @Override
View Full Code Here

                // get authorization code
                final String authorizationCode = params.get("code");

                // get OAuth token
                final IBoxOAuthManager oAuthManager = boxClient.getOAuthManager();
                final BoxOAuthToken oAuthToken = oAuthManager.createOAuth(authorizationCode,
                    configuration.getClientId(), configuration.getClientSecret(), null);

                // send initial token to BoxClient and this.listener
                final OAuthDataMessage authDataMessage = new OAuthDataMessage(oAuthToken,
                    boxClient.getJSONParser(), boxClient.getResourceHub());
View Full Code Here

TOP

Related Classes of com.box.boxjavalibv2.BoxConnectionManagerBuilder$BoxConnectionManager

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.