Interface GroupTypeService
- All Superinterfaces:
ContextSensitiveSingletonService
,Service
Provides the main functionality needed to create, update, delete, and get
groups types.
GroupType
GroupType
can be
customized to have different Attributes
Attribute
.
The attribute types that are supported are listed below. There are five
primitive types and two Appian types -
User User
and
Group Group
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Integer
The action of add to a group type's dynamic attributesstatic final Integer
The action of deleting a group typestatic final Integer
The action of delete a group type's dynamic attributesstatic final Integer
The action of editing a group typestatic final Integer
The action of edit a group type's dynamic attributesstatic final Integer
The action of modifying a group type's security settingsstatic final Integer
The action of using a group type (creating groups of that type)static final Integer
The action of viewing a group type's attributesstatic final Integer
The action of viewing a group typestatic final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final boolean
static final Integer
Type for attributes that are booleansstatic final Integer
Type for attributes that are datesstatic final Integer
Type for attributes that are decimalsstatic final Integer
Type for attributes that are Appian GroupsGroup
static final Integer
Type for attributes that are integersstatic final Integer
Type for attributes that are stringsstatic final Integer
Type for attributes that are Appian UsersUser
static final boolean
Fields inherited from interface com.appiancorp.services.ContextSensitiveSingletonService
CONFIGURE_METHOD_NAME
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(Long groupTypeId_, Attribute attribute_) Adds a new attribute to a group type.createGroupType
(GroupType groupType_) Creates a new group type.void
deleteAttribute
(Long groupTypeId_, String attributeName_) Deletes a single attribute from a given group type The attribute will also be deleted from groups that reference this group type.void
deleteGroupType
(Long groupTypeId_) Deletes a single group type.void
deleteGroupTypes
(Long[] groupTypeIds_) Deletes a list of group types.boolean
doesGroupTypeExist
(Long groupTypeId_) Determines whether a given group type existsboolean
doesGroupTypeExist
(String groupTypeName_) Checks to see if a given group type existsgetAllGroupTypeAttributes
(Long groupTypeId_) Gets the list of group type attributes for a particular group type, both fixed and dynamic attributes.getAllGroupTypeAttributesForGroupRules
(Long groupTypeId_) Deprecated.Gets a list of all group typesGets the name of the application on which this service is running.getGroupType
(Long groupTypeId_) Gets a group type by ID.Boolean[]
getGroupTypeActions
(Long groupTypeId_, Integer[] actionIds_) Gets Boolean array for the actions passed in, that indicates whether the actions can be performed on the given group type by the current user.getGroupTypeAttributes
(Long groupTypeId_) Gets the list of fixed attributes for a given group type.getGroupTypeId
(String groupTypeName_) Gets the ID for a given group type, by group type name.Long[]
getGroupTypeIds
(String[] groupTypeNames_) Gets a list of group type ids for a given set of group type names.getGroupTypeName
(Long groupTypeId_) Gets the name of the group type that corresponds to a given group type ID.String[]
getGroupTypeNames
(Long[] groupTypeIds_) Gets the names of the group types that correspond to a given list of group type IDs.getGroupTypes
(Long[] groupTypeIds_) Gets a list of group types by IDOperator[]
getOperatorsForDataType
(int dataType_) Gets a list of possible operators for a given data type.String[]
Gets the current memory profile for the workspace.boolean
isAttributeUnique
(String attributeName_, Long groupTypeId_) Determines whether a given attribute name is unique for a particular group typevoid
updateGroupType
(GroupType groupType_) Updates a group type's name and description.Methods inherited from interface com.appiancorp.services.ContextSensitiveSingletonService
configureContextSensitiveSingletonService
-
Field Details
-
TYPE_BOOLEAN
Type for attributes that are booleans -
TYPE_STRING
Type for attributes that are strings -
TYPE_INTEGER
Type for attributes that are integers -
TYPE_FLOAT
Type for attributes that are decimals -
TYPE_DATE
Type for attributes that are dates -
TYPE_USER
Type for attributes that are Appian UsersUser
-
TYPE_GROUP
Type for attributes that are Appian GroupsGroup
-
ACTION_GROUPTYPE_DELETE_GROUPTYPE
The action of deleting a group type -
ACTION_GROUPTYPE_MODIFY_GROUPTYPE_SECURITY_SETTINGS
The action of modifying a group type's security settings -
ACTION_GROUPTYPE_EDIT_GROUPTYPE_ATTRIBUTES
The action of editing a group type -
ACTION_GROUPTYPE_VIEW_GROUPTYPE_ATTRIBUTES
The action of viewing a group type's attributes -
ACTION_GROUPTYPE_DELETE_GROUPTYPE_DYNAMIC_ATTRIBUTES
The action of delete a group type's dynamic attributes -
ACTION_GROUPTYPE_EDIT_GROUPTYPE_DYNAMIC_ATTRIBUTES
The action of edit a group type's dynamic attributes -
ACTION_GROUPTYPE_ADD_GROUPTYPE_DYNAMIC_ATTRIBUTES
The action of add to a group type's dynamic attributes -
ACTION_GROUPTYPE_USE_GROUPTYPE
The action of using a group type (creating groups of that type) -
ACTION_GROUPTYPE_VIEW_GROUPTYPE_EXISTENCE
The action of viewing a group type -
addAttribute$UPDATES
static final boolean addAttribute$UPDATES- See Also:
-
createGroupType$UPDATES
static final boolean createGroupType$UPDATES- See Also:
-
deleteAttribute$UPDATES
static final boolean deleteAttribute$UPDATES- See Also:
-
deleteGroupType$UPDATES
static final boolean deleteGroupType$UPDATES- See Also:
-
deleteGroupTypes$UPDATES
static final boolean deleteGroupTypes$UPDATES- See Also:
-
getGroupTypeAttributes$UPDATES
static final boolean getGroupTypeAttributes$UPDATES- See Also:
-
getGroupType$UPDATES
static final boolean getGroupType$UPDATES- See Also:
-
getGroupTypeId$UPDATES
static final boolean getGroupTypeId$UPDATES- See Also:
-
getGroupTypeIds$UPDATES
static final boolean getGroupTypeIds$UPDATES- See Also:
-
getAllGroupTypes$UPDATES
static final boolean getAllGroupTypes$UPDATES- See Also:
-
getGroupTypes$UPDATES
static final boolean getGroupTypes$UPDATES- See Also:
-
getGroupTypeName$UPDATES
static final boolean getGroupTypeName$UPDATES- See Also:
-
getGroupTypeNames$UPDATES
static final boolean getGroupTypeNames$UPDATES- See Also:
-
updateGroupType$UPDATES
static final boolean updateGroupType$UPDATES- See Also:
-
getOperatorsForDataType$UPDATES
static final boolean getOperatorsForDataType$UPDATES- See Also:
-
doesGroupTypeExist$UPDATES
static final boolean doesGroupTypeExist$UPDATES- See Also:
-
getGroupTypeActions$UPDATES
static final boolean getGroupTypeActions$UPDATES- See Also:
-
isAttributeUnique$UPDATES
static final boolean isAttributeUnique$UPDATES- See Also:
-
getAllGroupTypeAttributes$UPDATES
static final boolean getAllGroupTypeAttributes$UPDATES- See Also:
-
getAllGroupTypeAttributesForGroupRules$UPDATES
static final boolean getAllGroupTypeAttributesForGroupRules$UPDATES- See Also:
-
getApplicationName$UPDATES
static final boolean getApplicationName$UPDATES- See Also:
-
getWorkspace$UPDATES
static final boolean getWorkspace$UPDATES- See Also:
-
-
Method Details
-
addAttribute
void addAttribute(Long groupTypeId_, Attribute attribute_) throws InvalidGroupTypeException, DuplicateNameException, UnsupportedAttributeTypeException, InvalidAttributeValueException Adds a new attribute to a group type.Attribute
names must be unique for a particular group type. In order to minimize possible breaks with the user interface, it is HIGHLY recommended that theAttribute
name be validated for illegal characters (only allow alphanumeric symbols and underscores).- Parameters:
attribute_
- theAttribute
to be added. The following fields must be populated in theAttribute
object:name
andtype
groupTypeId_
- the ID of the group type to which to add the attribute- Throws:
InvalidGroupTypeException
- if the no group type with the given ID existsDuplicateNameException
- if there already exists an attribute for the given group type with the given nameUunsupportedAttributeTypeException
- if the type of the attribute is invalidInvalidAttributeValueException
- if the value of the attribute is incompatible with its type. This may occur if the type of thevalue
field does not match the value of thetype
field, or if an invalid number or too large a number is given for attribute typeAttribute.TYPE_FLOAT
orAttribute.TYPE_INTEGER
ServiceException
- if any system-level error occursUnsupportedAttributeTypeException
-
createGroupType
Long createGroupType(GroupType groupType_) throws DuplicateNameException, InvalidNameException, InvalidUserException, InvalidAttributeValueException, DuplicateUuidException Creates a new group type.The name of group type must be unique among all group types. In order to minimize possible breaks with the user interface, it is HIGHLY recommended that the
GroupType
name be validated for illegal characters (only allow alphanumeric symbols and underscores).- Parameters:
groupType_
- the group type to be created.GroupType
fields required for creation are:groupTypeName
andcreator
.- Returns:
- the ID of the created group type
- Throws:
DuplicateNameException
- if a group type already exists with the given nameInvalidNameException
- if the group type name is null.InvalidUserException
- if an invalid user is passed as creator of the group type.InvalidAttributeValueException
- if the value of a group type attribute is incompatible with its type. This may occur if the type of thevalue
field does not match the value of thetype
field, or if an invalid number or too large a number is given for attribute typeAttribute.TYPE_FLOAT
orAttribute.TYPE_INTEGER
DuplicateUuidException
- if the UUID passed in already exists in the system.ServiceException
- if any system-level error occurs
-
deleteAttribute
void deleteAttribute(Long groupTypeId_, String attributeName_) throws InvalidGroupTypeException, InvalidAttributeException, SystemAttributeException Deletes a single attribute from a given group type The attribute will also be deleted from groups that reference this group type.- Parameters:
groupTypeId_
- the group type IDattributeName_
- the attribute name- Throws:
InvalidGroupTypeException
- if the group type ID does not refer to a valid group typeInvalidAttributeException
- if the group type does not have an attribute with the given nameSystemAttributeException
- if the attribute is a system level attributeServiceException
- if any system-level error occurs
-
deleteGroupType
void deleteGroupType(Long groupTypeId_) throws InvalidGroupTypeException, GroupsExtantException, SystemGroupTypeException Deletes a single group type. Deleting a group type is possible only if there are no existing groups of the given type. To check for any groups of a given group type, useGroupService.getGroupsOfType(Long)
.- Parameters:
groupTypeId_
- the ID of group type to delete- Throws:
InvalidGroupTypeException
- if the group type ID does not refer to a valid group typeGroupsExtantException
- if there exist groups of the given group type or if there exist group rules that reference the given group typeSystemGroupTypeException
- if the group type being deleted is a system group typeServiceException
- if any system-level error occurs
-
deleteGroupTypes
void deleteGroupTypes(Long[] groupTypeIds_) throws InvalidGroupTypeException, GroupsExtantException, SystemGroupTypeException Deletes a list of group types. Deleting a group type is possible only if there are no existing groups of the given type. To check for any groups of a given group type, useGroupService.getGroupsOfType(Long)
.- Parameters:
groupTypeIds_
- the list of IDs of group types to delete- Throws:
InvalidGroupTypeException
- if any group type ID does not refer to a valid group typeGroupsExtantException
- if there exist groups of any of the given group types or if there exist group rules that reference any of the given group typesSystemGroupTypeException
- if the group type being deleted is a system group typeServiceException
- if any system-level error occurs
-
getGroupTypeAttributes
Gets the list of fixed attributes for a given group type. Fixed attributes arename
,description
,creator
,timestampModified
,timestampCreated
.- Parameters:
groupTypeId_
- the ID of the group type for which to retrieve attributes- Returns:
- the
Attribute
list;null
if the group type has no attributes - Throws:
InvalidGroupTypeException
- if the group type ID does not refer to a valid group typeServiceException
- if any system-level error occurs
-
getGroupType
Gets a group type by ID.- Parameters:
groupTypeId_
- the Id of the group type- Returns:
- the group type
- Throws:
InvalidGroupTypeException
- if the group type ID does not refer to a valid group typeServiceException
- if any system-level error occurs
-
getGroupTypeId
Gets the ID for a given group type, by group type name.- Parameters:
groupTypeName_
- the name of group type- Returns:
- the ID of the requested group type; -1 if no group type with the given name exists
- Throws:
ServiceException
- if any system-level error occurs
-
getGroupTypeIds
Gets a list of group type ids for a given set of group type names.- Parameters:
groupTypeNames_
- the list of group type names- Returns:
- the list of group type IDs; -1 will be returned for a group type name if no group type with that name exists
- Throws:
ServiceException
- if any system-level error occurs
-
getAllGroupTypes
GroupType[] getAllGroupTypes()Gets a list of all group types- Returns:
- the list of all group types
- Throws:
ServiceException
- if any system-level error occurs
-
getGroupTypes
Gets a list of group types by ID- Parameters:
groupTypeIds_
- a list of group type IDs- Returns:
- the list of group types corresponding to the given IDs
- Throws:
InvalidGroupTypeException
- if any group type ID does not refer to a valid group typeServiceException
- if any system-level error occurs
-
getGroupTypeName
Gets the name of the group type that corresponds to a given group type ID.- Parameters:
groupTypeId_
- the group type id- Returns:
- the name of the group type
- Throws:
InvalidGroupTypeException
- if the group type ID does not refer to a valid group typeServiceException
- if any system-level error occurs
-
getGroupTypeNames
Gets the names of the group types that correspond to a given list of group type IDs.- Parameters:
groupTypeIds_
- the group type ids- Returns:
- the names of the group types
- Throws:
InvalidGroupTypeException
- if any group type ID does not refer to a valid group typeServiceException
- if any system-level error occurs
-
updateGroupType
Updates a group type's name and description. Name of group type must be unique. NOTE: To modify a group type's attributes, useaddAttribute(java.lang.Long, com.appiancorp.suiteapi.personalization.Attribute)
anddeleteAttribute(java.lang.Long, java.lang.String)
In order to minimize possible breaks with the user interface, it is HIGHLY recommended that the group type name be validated for illegal characters (only allow alphanumeric symbols and underscores).
- Parameters:
groupType_
- The group type to be updated- Throws:
InvalidGroupTypeException
- if the group type ID does not refer to a valid group typeDuplicateNameException
- if a group type with the given name already existsServiceException
- if any system-level error occurs
-
getOperatorsForDataType
Gets a list of possible operators for a given data type. Use this function when updating an attribute or when you need to obtain a list of operators to conduct a user or group search.- Parameters:
dataType_
- one of theTYPE_XXX
constants- Returns:
- an array of valid operators for the data type
- Throws:
UnsupportedAttributeTypeException
- if the data type is invalidServiceException
- if any system-level error occurs
-
doesGroupTypeExist
Determines whether a given group type exists- Parameters:
groupTypeId_
- the ID of group type- Returns:
true
if the group type exists,false
otherwise.- Throws:
ServiceException
- if any system-level error occurs
-
doesGroupTypeExist
Checks to see if a given group type exists- Parameters:
groupTypeName_
- the name of group type- Returns:
true
if group type exists,false
otherwise- Throws:
ServiceException
- if any system-level error occurs
-
getGroupTypeActions
Boolean[] getGroupTypeActions(Long groupTypeId_, Integer[] actionIds_) throws InvalidGroupTypeException Gets Boolean array for the actions passed in, that indicates whether the actions can be performed on the given group type by the current user. For each item in the returned array,Boolean.TRUE
indicates that the current user can perform the action.- Parameters:
groupTypeId_
- the group type ID.actionIds_
- IDs of actions to check. Each ID must be one of theACTION_GROUPTYPE_XXX
constants- Returns:
- Boolean array indicating which of the actions the current user can perform
- Throws:
InvalidGroupTypeException
- if the group type ID does not refer to a valid group typeServiceException
- if any system-level error occurs
-
isAttributeUnique
boolean isAttributeUnique(String attributeName_, Long groupTypeId_) throws InvalidGroupTypeException Determines whether a given attribute name is unique for a particular group type- Parameters:
attributeName_
- the name of attributegroupTypeId_
- the ID of the group type- Returns:
true
if the group type does not already have an attribute with the given name;false
otherwise- Throws:
InvalidGroupTypeException
- if the group type ID does not refer to a valid group typeServiceException
- if any system-level error occurs
-
getAllGroupTypeAttributes
Gets the list of group type attributes for a particular group type, both fixed and dynamic attributes. Fixed attributes arename
,description
,creator
,timestampModified
,timestampCreated
. Dynamic attributes are those that specific to the group type. For example, a user can add an attribute ofTYPE_USER
after the group type is created, and that will be returned in this call, but not in- Throws:
InvalidGroupTypeException
-
getAllGroupTypeAttributesForGroupRules
@Deprecated Attribute[] getAllGroupTypeAttributesForGroupRules(Long groupTypeId_) throws InvalidGroupTypeException Deprecated.Gets the list of group type attributes for a particular group type, both fixed and dynamic attributes. Excludes dynamic attributes that are invalid for use in rules. Fixed attributes arename
,description
,creator
,timestampModified
,timestampCreated
. Dynamic attributes are those that specific to the group type. For example, a user can add an attribute ofTYPE_USER
after the group type is created, and that will be returned in this call, but not in- Throws:
InvalidGroupTypeException
-
getApplicationName
String getApplicationName()Gets the name of the application on which this service is running.- Returns:
- the name of the application
- Throws:
ServiceException
- if any system-level error occurs
-
getWorkspace
String[] getWorkspace()Gets the current memory profile for the workspace.- Returns:
- array of Strings of length 4 describing memory usage:
- [0]Used - Memory Used by the Server so far for storage
- [1]Allocated - Memory allocated for use. Often if a large data item was allocated by a server and subsequently freed, this value will be large compared to "Used". If nearly all memory allocated is in use, this value will be close to (but always higher than) "Used"
- [2]Mapped - is the space used by memory-mapped files
- [3]Available - is the total available memory for the Server process
- Throws:
ServiceException
- if any system-level error occurs
-