public Group createGroup() { return new Group(); }
switch (scimObjectType) { case SCIMCommonConstants.GROUP: scimObject = new Group(); log.debug("Building Group Object"); break;
switch (scimObjectType) { case SCIMCommonConstants.GROUP: scimObject = new Group(); log.debug("Building Group Object"); break;
switch (scimObjectType) { case SCIM2CommonConstants.GROUP: scimObject = new Group(); if (debug) { log.debug("Building Group Object");
switch (scimObjectType) { case SCIMCommonConstants.GROUP: scimObject = new Group(); if (log.isDebugEnabled()) { log.debug("Building Group Object");
/** * Deletes the group. * * @param groupEntity * @throws IdentityProvisioningException */ private void deleteGroup(ProvisioningEntity groupEntity) throws IdentityProvisioningException { String groupName = null; try { List<String> groupNames = getGroupNames(groupEntity.getAttributes()); if (CollectionUtils.isNotEmpty(groupNames)) { groupName = groupNames.get(0); } Group group = new Group(); group.setDisplayName(groupName); ProvisioningClient scimProvsioningClient = new ProvisioningClient(scimProvider, group, null); scimProvsioningClient.provisionDeleteGroup(); } catch (Exception e) { throw new IdentityProvisioningException("Error while deleting group : " + groupName, e); } }
/** * Get group with only meta attributes. * * @param groupName * @return * @throws CharonException * @throws IdentitySCIMException * @throws org.wso2.carbon.user.core.UserStoreException */ private Group getGroupOnlyWithMetaAttributes(String groupName) throws CharonException, IdentitySCIMException, org.wso2.carbon.user.core.UserStoreException, BadRequestException { //get other group attributes and set. Group group = new Group(); group.setDisplayName(groupName); SCIMGroupHandler groupHandler = new SCIMGroupHandler(carbonUM.getTenantId()); return groupHandler.getGroupWithAttributes(group, groupName); }
/** * This is to decode SCIM Response received for a SCIM List/Filter requests. * * @param scimResponse * @param format * @param containedResourceType * @return */ public List<SCIMObject> decodeSCIMResponseWithListedResource(String scimResponse, String format, int containedResourceType) throws CharonException, BadRequestException { if ((format.equals(SCIMConstants.JSON)) && (jsonDecoder != null)) { SCIMDecoder scimDecoder = new SCIMDecoder(); switch (containedResourceType) { case 1: return scimDecoder.decodeListedResource(scimResponse, SCIMSchemaDefinitions.SCIM_USER_SCHEMA, new User()); case 2: return scimDecoder.decodeListedResource(scimResponse, SCIMSchemaDefinitions.SCIM_GROUP_SCHEMA, new Group()); default: throw new CharonException("Resource type didn't match any existing types."); } } else { throw new CharonException("Encoder in the given format is not properly initialized."); } }
groupName = groupNames.get(0); Group group = new Group(); group.setDisplayName(groupName); List<String> userList = getUserNames(groupEntity.getAttributes());
/** * Creates the group. * * @param groupEntity * @return * @throws IdentityProvisioningException */ private String createGroup(ProvisioningEntity groupEntity) throws IdentityProvisioningException { String groupName = null; try { List<String> groupNames = getGroupNames(groupEntity.getAttributes()); if (CollectionUtils.isNotEmpty(groupNames)) { groupName = groupNames.get(0); } Group group = new Group(); group.setDisplayName(groupName); List<String> userList = getUserNames(groupEntity.getAttributes()); setGroupMembers(group, userList); ProvisioningClient scimProvsioningClient = new ProvisioningClient(scimProvider, group, null); scimProvsioningClient.provisionCreateGroup(); } catch (Exception e) { throw new IdentityProvisioningException("Error while adding group : " + groupName, e); } return null; }
private SCIMObject decodeSCIMResponse(String scimResponse, JSONDecoder decoder, int resourceType) throws AbstractCharonException { switch (resourceType) { case 1: User userObject = (User) decoder.decodeResource(scimResponse, SCIMSchemaDefinitions.SCIM_USER_SCHEMA, new User()); ClientSideValidator.validateRetrievedSCIMObject(userObject, SCIMSchemaDefinitions.SCIM_USER_SCHEMA); return userObject; case 2: Group groupObject = (Group) decoder.decodeResource(scimResponse, SCIMSchemaDefinitions.SCIM_GROUP_SCHEMA, new Group()); ClientSideValidator.validateRetrievedSCIMObject(groupObject, SCIMSchemaDefinitions.SCIM_GROUP_SCHEMA); return groupObject; default: throw new CharonException("Resource type didn't match any existing types."); } }
Group group = new Group(); group.setDisplayName(groupName); String[] userNames = carbonUM.getUserListOfRole(groupName);