public class GroupType extends GrouperAPI implements Serializable, Comparable
| Modifier and Type | Field and Description |
|---|---|
static String |
COLUMN_OLD_ID
old id col for id conversion
|
static String |
COLUMN_OLD_TYPE_UUID
old uuid id col for id conversion
|
static String |
COLUMN_TYPE_UUID
uuid col in db
|
static String |
FIELD_CREATE_TIME
constant for field name for: createTime
|
static String |
FIELD_NAME
constant for field name for: name
|
static String |
FIELD_UUID
constant for field name for: uuid
|
static long |
serialVersionUID |
static String |
TABLE_OLD_GROUPER_TYPES
name of table for grouper_types
|
COLUMN_HIBERNATE_VERSION_NUMBER, dbVersion, FIELD_DB_VERSION, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER| Constructor and Description |
|---|
GroupType() |
dbVersion, dbVersionClear, dbVersionDifferentFields, dbVersionIsDifferent, dbVersionReset, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onPostDelete, onPostSave, onPostUpdate, onPreDelete, onPreSave, onPreUpdate, onSave, onUpdate, setHibernateVersionNumberpublic static final String TABLE_OLD_GROUPER_TYPES
public static final String COLUMN_TYPE_UUID
public static final String COLUMN_OLD_ID
public static final String COLUMN_OLD_TYPE_UUID
public static final String FIELD_CREATE_TIME
public static final String FIELD_NAME
public static final String FIELD_UUID
public static final long serialVersionUID
public static GroupType createType(GrouperSession s, String name) throws InsufficientPrivilegeException, SchemaException
GroupType.
Create a new custom group type that can be assigned to existing or
new groups. If the type already exists, a SchemaException
will be thrown. If the subject is not root-like, an
InsufficientPrivilegeException will be thrown.
try {
GroupType type = GroupType.createType(s, "my custom type");
}
catch (InsufficientPrivilegeException eIP) {
// Subject not privileged to add group types.
}
catch (SchemaException eS) {
// Type not created
}
s - Create type within this session context.name - Create type with this name.GroupType.InsufficientPrivilegeExceptionSchemaExceptionpublic static GroupType createType(GrouperSession s, String name, boolean exceptionIfExists) throws InsufficientPrivilegeException, SchemaException
GroupType.
Create a new custom group type that can be assigned to existing or
new groups. If the type already exists, a SchemaException
will be thrown. If the subject is not root-like, an
InsufficientPrivilegeException will be thrown.
try {
GroupType type = GroupType.createType(s, "my custom type");
}
catch (InsufficientPrivilegeException eIP) {
// Subject not privileged to add group types.
}
catch (SchemaException eS) {
// Type not created
}
s - Create type within this session context.name - Create type with this name.exceptionIfExists - GroupType.InsufficientPrivilegeExceptionSchemaExceptionpublic static GroupType createType(GrouperSession s, String name, boolean exceptionIfExists, String uuid) throws InsufficientPrivilegeException, SchemaException
GroupType.
Create a new custom group type that can be assigned to existing or
new groups. If the type already exists, a SchemaException
will be thrown. If the subject is not root-like, an
InsufficientPrivilegeException will be thrown.
try {
GroupType type = GroupType.createType(s, "my custom type");
}
catch (InsufficientPrivilegeException eIP) {
// Subject not privileged to add group types.
}
catch (SchemaException eS) {
// Type not created
}
s - Create type within this session context.name - Create type with this name.exceptionIfExists - uuid - GroupType.InsufficientPrivilegeExceptionSchemaExceptionpublic String getContextId()
public void setContextId(String contextId1)
contextId1 - public AttributeDefName addAttribute(GrouperSession s, String name) throws InsufficientPrivilegeException, SchemaException
Field to a custom GroupType.
try {
Field myAttr = type.addAttribute(
"my attribute", AccessPrivilege.VIEW, AccessPrivilege.UPDATE, false
);
}
catch (InsufficientPrivilegeException eIP) {
// Not privileged to add attribute
}
catch (SchemaException eS) {
// Invalid schema
}
s - Add attribute within this session context.name - Name of attribute.InsufficientPrivilegeExceptionSchemaExceptionpublic AttributeDefName addAttribute(GrouperSession s, String name, boolean exceptionIfExists) throws InsufficientPrivilegeException, SchemaException
Field to a custom GroupType.
try {
Field myAttr = type.addAttribute(
"my attribute", AccessPrivilege.VIEW, AccessPrivilege.UPDATE, false
);
}
catch (InsufficientPrivilegeException eIP) {
// Not privileged to add attribute
}
catch (SchemaException eS) {
// Invalid schema
}
s - Add attribute within this session context.name - Name of attribute.exceptionIfExists - InsufficientPrivilegeExceptionSchemaExceptionpublic AttributeDefName addAttribute(GrouperSession s, String name, boolean exceptionIfExists, String uuid) throws InsufficientPrivilegeException, SchemaException
Field to a custom GroupType.
try {
Field myAttr = type.addAttribute(
"my attribute", AccessPrivilege.VIEW, AccessPrivilege.UPDATE, false
);
}
catch (InsufficientPrivilegeException eIP) {
// Not privileged to add attribute
}
catch (SchemaException eS) {
// Invalid schema
}
s - Add attribute within this session context.name - Name of attribute.exceptionIfExists - uuid - InsufficientPrivilegeExceptionSchemaExceptionpublic Field addList(GrouperSession s, String name, Privilege read, Privilege write) throws InsufficientPrivilegeException, SchemaException
Field to a custom GroupType.
try {
Field myList = type.addList(
s, "my list", AccessPrivilege.VIEW, AccessPrivilege.UPDATE
);
}
catch (InsufficientPrivilegeException eIP) {
// Not privileged to add list
}
catch (SchemaException eS) {
// Invalid schema
}
s - Add list within this session context.name - Name of list.read - Privilege required to write to this Field.write - Privilege required to write to this Field.InsufficientPrivilegeExceptionSchemaExceptionpublic Field internal_addList(GrouperSession s, String name, Privilege read, Privilege write, String fieldId, boolean exceptionIfExists) throws InsufficientPrivilegeException, SchemaException
s - name - read - write - fieldId - exceptionIfExists - InsufficientPrivilegeExceptionSchemaExceptionpublic void delete(GrouperSession s) throws InsufficientPrivilegeException, SchemaException
GroupType definition.
try {
aGroupType.delete(s);
}
catch (InsufficientPrivilegeException eIP) {
// Subject not privileged to delete group type.
}
catch (SchemaException eS) {
// Type could not be deleted
}
s - Delete type within this session context.InsufficientPrivilegeExceptionSchemaExceptionpublic void deleteField(GrouperSession s, String name) throws InsufficientPrivilegeException, SchemaException
Field from a custom GroupType.
Delete a field from this group type. If the field does not exist
in this type a SchemaException will be thrown. If the
subject is not root-like, an InsufficientPrivilegeException
will be thrown.
try {
type.deleteField(s, "my field");
);
}
catch (InsufficientPrivilegeException eIP) {
// Not privileged to delete field
}
catch (SchemaException eS) {
// Invalid schema
}
s - Delete field within this session context.name - Name of field to delete.InsufficientPrivilegeExceptionSchemaExceptionpublic boolean isSystemType()
public static GroupType internal_createType(GrouperSession s, String name, boolean exceptionIfExists, boolean[] changed, String uuid) throws InsufficientPrivilegeException, SchemaException
s - name - exceptionIfExists - changed - boolean array, the fisrt index will be in it existed alreadyuuid - to use or null for one to be assignedInsufficientPrivilegeExceptionSchemaExceptionpublic boolean equals(Object other)
equals in class ObjectObject.equals(java.lang.Object)public long getCreateTime()
public String getName()
public String getUuid()
public void setCreateTime(long createTime)
createTime - public void setFields(Set fields)
fields - public void setName(String name)
name - public void setUuid(String uuid)
uuid - public GroupType clone()
clone in interface GrouperCloneableclone in class GrouperAPIObject.clone()public int compareTo(Object o)
compareTo in interface ComparableComparable.compareTo(java.lang.Object)public AttributeDefName getAttributeDefName()
public void internalSetAttributeDefName(AttributeDefName attributeDefName1)
attributeDefName1 - public static GroupType internal_getGroupType(AttributeDefName attribute, boolean exceptionIfNotLegacyGroupType)
attribute - exceptionIfNotLegacyGroupType - public AttributeDef internal_getAttributeDefForAttributes()
public AttributeDef internal_getAttributeDefForCustomLists()
public AttributeDefName internal_getAttributeDefNameForCustomLists()
public Set<AttributeDefName> getLegacyAttributes()
Copyright © 2016 Internet2. All rights reserved.