Package edu.internet2.middleware.grouper
Class GroupType
java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.GroupType
- All Implemented Interfaces:
HibGrouperLifecycle
,GrouperCloneable
,GrouperUtil.FieldValuable
,Serializable
,Comparable
,org.hibernate.classic.Lifecycle
Schema specification for a Group type.
- Version:
- $Id: GroupType.java,v 1.89 2009-06-10 05:31:35 mchyzer Exp $
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
old id col for id conversionstatic final String
old uuid id col for id conversionstatic final String
uuid col in dbstatic final String
constant for field name for: createTimestatic final String
constant for field name for: namestatic final String
constant for field name for: uuidstatic final long
static final String
name of table for grouper_typesFields inherited from class edu.internet2.middleware.grouper.GrouperAPI
COLUMN_HIBERNATE_VERSION_NUMBER, dbVersion, FIELD_DB_VERSION, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER
Fields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAttribute
(GrouperSession s, String name) Deprecated.addAttribute
(GrouperSession s, String name, boolean exceptionIfExists) Deprecated.addAttribute
(GrouperSession s, String name, boolean exceptionIfExists, String uuid) Deprecated.addList
(GrouperSession s, String name, Privilege read, Privilege write) Deprecated.clone()
deep clone the fields in this objectint
static GroupType
createType
(GrouperSession s, String name) Deprecated.static GroupType
createType
(GrouperSession s, String name, boolean exceptionIfExists) Deprecated.static GroupType
createType
(GrouperSession s, String name, boolean exceptionIfExists, String uuid) Deprecated.void
Deprecated.void
deleteField
(GrouperSession s, String name) Deprecated.boolean
context id of the transactionlong
getName()
getUuid()
int
hashCode()
internal_addList
(GrouperSession s, String name, Privilege read, Privilege write, String fieldId, boolean exceptionIfExists) static GroupType
internal_createType
(GrouperSession s, String name, boolean exceptionIfExists, boolean[] changed, String uuid) static GroupType
internal_getGroupType
(AttributeDefName attribute, boolean exceptionIfNotLegacyGroupType) void
internalSetAttributeDefName
(AttributeDefName attributeDefName1) boolean
void
setContextId
(String contextId1) context id of the transactionvoid
setCreateTime
(long createTime) void
void
void
toString()
Methods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersion, dbVersionClear, dbVersionDifferentFields, dbVersionIsDifferent, dbVersionReset, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onPostDelete, onPostSave, onPostUpdate, onPreDelete, onPreSave, onPreUpdate, onSave, onUpdate, setHibernateVersionNumber
-
Field Details
-
TABLE_OLD_GROUPER_TYPES
name of table for grouper_types- See Also:
-
COLUMN_TYPE_UUID
uuid col in db- See Also:
-
COLUMN_OLD_ID
old id col for id conversion- See Also:
-
COLUMN_OLD_TYPE_UUID
old uuid id col for id conversion- See Also:
-
FIELD_CREATE_TIME
constant for field name for: createTime- See Also:
-
FIELD_NAME
constant for field name for: name- See Also:
-
FIELD_UUID
constant for field name for: uuid- See Also:
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
-
Constructor Details
-
GroupType
public GroupType()
-
-
Method Details
-
createType
public static GroupType createType(GrouperSession s, String name) throws InsufficientPrivilegeException, SchemaException Deprecated.Create a newGroupType
. Create a new custom group type that can be assigned to existing or new groups. If the type already exists, aSchemaException
will be thrown. If the subject is not root-like, anInsufficientPrivilegeException
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 }
- Parameters:
s
- Create type within this session context.name
- Create type with this name.- Returns:
- New
GroupType
. - Throws:
InsufficientPrivilegeException
SchemaException
-
createType
public static GroupType createType(GrouperSession s, String name, boolean exceptionIfExists) throws InsufficientPrivilegeException, SchemaException Deprecated.Create a newGroupType
. Create a new custom group type that can be assigned to existing or new groups. If the type already exists, aSchemaException
will be thrown. If the subject is not root-like, anInsufficientPrivilegeException
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 }
- Parameters:
s
- Create type within this session context.name
- Create type with this name.exceptionIfExists
-- Returns:
- New
GroupType
. - Throws:
InsufficientPrivilegeException
SchemaException
-
createType
public static GroupType createType(GrouperSession s, String name, boolean exceptionIfExists, String uuid) throws InsufficientPrivilegeException, SchemaException Deprecated.Create a newGroupType
. Create a new custom group type that can be assigned to existing or new groups. If the type already exists, aSchemaException
will be thrown. If the subject is not root-like, anInsufficientPrivilegeException
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 }
- Parameters:
s
- Create type within this session context.name
- Create type with this name.exceptionIfExists
-uuid
-- Returns:
- New
GroupType
. - Throws:
InsufficientPrivilegeException
SchemaException
-
getContextId
context id of the transaction- Returns:
- context id
-
setContextId
context id of the transaction- Parameters:
contextId1
-
-
addAttribute
public AttributeDefName addAttribute(GrouperSession s, String name) throws InsufficientPrivilegeException, SchemaException Deprecated.Add a custom attributeField
to a customGroupType
. 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 }- Parameters:
s
- Add attribute within this session context.name
- Name of attribute.- Returns:
- field
- Throws:
InsufficientPrivilegeException
SchemaException
-
addAttribute
public AttributeDefName addAttribute(GrouperSession s, String name, boolean exceptionIfExists) throws InsufficientPrivilegeException, SchemaException Deprecated.Add a custom attributeField
to a customGroupType
. 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 }- Parameters:
s
- Add attribute within this session context.name
- Name of attribute.exceptionIfExists
-- Returns:
- field
- Throws:
InsufficientPrivilegeException
SchemaException
-
addAttribute
public AttributeDefName addAttribute(GrouperSession s, String name, boolean exceptionIfExists, String uuid) throws InsufficientPrivilegeException, SchemaException Deprecated.Add a custom attributeField
to a customGroupType
. 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 }- Parameters:
s
- Add attribute within this session context.name
- Name of attribute.exceptionIfExists
-uuid
-- Returns:
- field
- Throws:
InsufficientPrivilegeException
SchemaException
-
addList
public Field addList(GrouperSession s, String name, Privilege read, Privilege write) throws InsufficientPrivilegeException, SchemaException Deprecated.Add a custom listField
to a customGroupType
. 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 }- Parameters:
s
- Add list within this session context.name
- Name of list.read
-Privilege
required to write to thisField
.write
-Privilege
required to write to thisField
.- Returns:
- field
- Throws:
InsufficientPrivilegeException
SchemaException
-
internal_addList
public Field internal_addList(GrouperSession s, String name, Privilege read, Privilege write, String fieldId, boolean exceptionIfExists) throws InsufficientPrivilegeException, SchemaException - Parameters:
s
-name
-read
-write
-fieldId
-exceptionIfExists
-- Returns:
- field
- Throws:
InsufficientPrivilegeException
SchemaException
-
delete
Deprecated.Delete a customGroupType
definition.try { aGroupType.delete(s); } catch (InsufficientPrivilegeException eIP) { // Subject not privileged to delete group type. } catch (SchemaException eS) { // Type could not be deleted }
- Parameters:
s
- Delete type within this session context.- Throws:
InsufficientPrivilegeException
SchemaException
- Since:
- 1.0
-
deleteField
public void deleteField(GrouperSession s, String name) throws InsufficientPrivilegeException, SchemaException Deprecated.Delete a customField
from a customGroupType
. Delete a field from this group type. If the field does not exist in this type aSchemaException
will be thrown. If the subject is not root-like, anInsufficientPrivilegeException
will be thrown.try { type.deleteField(s, "my field"); ); } catch (InsufficientPrivilegeException eIP) { // Not privileged to delete field } catch (SchemaException eS) { // Invalid schema }
- Parameters:
s
- Delete field within this session context.name
- Name of field to delete.- Throws:
InsufficientPrivilegeException
SchemaException
-
isSystemType
public boolean isSystemType()- Returns:
- true if system type
-
internal_createType
public static GroupType internal_createType(GrouperSession s, String name, boolean exceptionIfExists, boolean[] changed, String uuid) throws InsufficientPrivilegeException, SchemaException - Parameters:
s
-name
-exceptionIfExists
-changed
- boolean array, the fisrt index will be in it existed alreadyuuid
- to use or null for one to be assigned- Returns:
- the type
- Throws:
InsufficientPrivilegeException
SchemaException
-
equals
-
getCreateTime
public long getCreateTime()- Returns:
- create time
- Since:
- 1.2.0
-
getFields
- Returns:
- fields
- Since:
- 1.2.0
-
getName
- Returns:
- name
- Since:
- 1.2.0
-
getUuid
- Returns:
- uuid
- Since:
- 1.2.0
-
hashCode
public int hashCode() -
setCreateTime
public void setCreateTime(long createTime) - Parameters:
createTime
-- Since:
- 1.2.0
-
setFields
- Parameters:
fields
-- Since:
- 1.2.0
-
setName
- Parameters:
name
-- Since:
- 1.2.0
-
setUuid
- Parameters:
uuid
-- Since:
- 1.2.0
-
toString
-
clone
deep clone the fields in this object- Specified by:
clone
in interfaceGrouperCloneable
- Specified by:
clone
in classGrouperAPI
- Returns:
- the clone of the object
- See Also:
-
compareTo
- Specified by:
compareTo
in interfaceComparable
- See Also:
-
getAttributeDefName
- Returns:
- attributeDefName that corresponds to this group type
-
internalSetAttributeDefName
- Parameters:
attributeDefName1
-
-
internal_getGroupType
public static GroupType internal_getGroupType(AttributeDefName attribute, boolean exceptionIfNotLegacyGroupType) - Parameters:
attribute
-exceptionIfNotLegacyGroupType
-- Returns:
- groupType
-
internal_getAttributeDefForAttributes
- Returns:
- the attributeDef for attribute assignments
-
internal_getAttributeDefForCustomLists
- Returns:
- the attributeDef for custom lists
-
internal_getAttributeDefNameForCustomLists
- Returns:
- the attributeDefName for custom lists
-
getLegacyAttributes
- Returns:
- legacy attributes
-