|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.GroupType
public class GroupType
Schema specification for a Group type.
Field Summary | |
---|---|
static java.lang.String |
COLUMN_OLD_ID
old id col for id conversion |
static java.lang.String |
COLUMN_OLD_TYPE_UUID
old uuid id col for id conversion |
static java.lang.String |
COLUMN_TYPE_UUID
uuid col in db |
static java.lang.String |
FIELD_CREATE_TIME
constant for field name for: createTime |
static java.lang.String |
FIELD_CREATOR_UUID
constant for field name for: creatorUUID |
static java.lang.String |
FIELD_DB_VERSION
constant for field name for: dbVersion |
static java.lang.String |
FIELD_IS_ASSIGNABLE
constant for field name for: isAssignable |
static java.lang.String |
FIELD_IS_INTERNAL
constant for field name for: isInternal |
static java.lang.String |
FIELD_NAME
constant for field name for: name |
static java.lang.String |
FIELD_UUID
constant for field name for: uuid |
static long |
serialVersionUID
|
static java.lang.String |
TABLE_GROUPER_TYPES
name of table for grouper_types |
Fields inherited from class edu.internet2.middleware.grouper.GrouperAPI |
---|
COLUMN_HIBERNATE_VERSION_NUMBER, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER |
Fields inherited from interface org.hibernate.classic.Lifecycle |
---|
NO_VETO, VETO |
Constructor Summary | |
---|---|
GroupType()
|
Method Summary | |
---|---|
Field |
addAttribute(GrouperSession s,
java.lang.String name,
Privilege read,
Privilege write,
boolean required)
Add a custom attribute Field to a custom GroupType . |
Field |
addAttribute(GrouperSession s,
java.lang.String name,
Privilege read,
Privilege write,
boolean required,
boolean exceptionIfExists)
Add a custom attribute Field to a custom GroupType . |
Field |
addList(GrouperSession s,
java.lang.String name,
Privilege read,
Privilege write)
Add a custom list Field to a custom GroupType . |
Field |
addOrUpdateAttribute(GrouperSession s,
java.lang.String name,
Privilege read,
Privilege write,
boolean required)
Add a custom attribute Field to a custom GroupType . |
GroupType |
clone()
deep clone the fields in this object |
int |
compareTo(java.lang.Object o)
|
static GroupType |
createType(GrouperSession s,
java.lang.String name)
Create a new GroupType . |
static GroupType |
createType(GrouperSession s,
java.lang.String name,
boolean exceptionIfExists)
Create a new GroupType . |
GroupType |
dbVersion()
save the state when retrieving from DB |
java.util.Set<java.lang.String> |
dbVersionDifferentFields()
note, these are massaged so that name, extension, etc look like normal fields. |
void |
dbVersionReset()
take a snapshot of the data since this is what is in the db |
void |
delete(GrouperSession s)
Delete a custom GroupType definition. |
void |
deleteField(GrouperSession s,
java.lang.String name)
Delete a custom Field from a custom GroupType . |
boolean |
equals(java.lang.Object other)
|
java.lang.String |
getContextId()
context id of the transaction |
long |
getCreateTime()
|
java.lang.String |
getCreatorUuid()
|
java.util.Set<Field> |
getFields()
|
boolean |
getIsAssignable()
|
boolean |
getIsInternal()
|
java.lang.String |
getName()
|
java.lang.String |
getUuid()
|
int |
hashCode()
|
Field |
internal_addField(GrouperSession s,
java.lang.String name,
FieldType type,
Privilege read,
Privilege write,
boolean required,
boolean exceptionIfExists,
boolean updateIfExists,
boolean[] changedArray,
java.lang.String uuid)
add a field if it is not already there |
static GroupType |
internal_createType(GrouperSession s,
java.lang.String name,
boolean isAssignable,
boolean isInternal,
boolean exceptionIfExists,
boolean[] changed,
java.lang.String uuid)
|
boolean |
isSystemType()
|
void |
onPostDelete(HibernateSession hibernateSession)
after a delete occurs |
void |
onPostSave(HibernateSession hibernateSession)
after a save (insert) occurs |
void |
onPostUpdate(HibernateSession hibernateSession)
after an update occurs |
void |
onPreDelete(HibernateSession hibernateSession)
before a delete (insert) occurs |
void |
onPreSave(HibernateSession hibernateSession)
before a save (insert) occurs |
void |
onPreUpdate(HibernateSession hibernateSession)
before an update occurs |
void |
setContextId(java.lang.String contextId1)
context id of the transaction |
void |
setCreateTime(long createTime)
|
void |
setCreatorUuid(java.lang.String creatorUUID)
|
void |
setFields(java.util.Set fields)
|
void |
setIsAssignable(boolean isAssignable)
|
void |
setIsInternal(boolean isInternal)
|
void |
setName(java.lang.String name)
|
void |
setUuid(java.lang.String uuid)
|
void |
store()
store this object to the DB. |
java.lang.String |
toString()
|
void |
xmlCopyBusinessPropertiesToExisting(GroupType existingRecord)
copy business (non update) properties to an existing record |
boolean |
xmlDifferentBusinessProperties(GroupType other)
see if the non update cols are different (e.g. name) |
boolean |
xmlDifferentUpdateProperties(GroupType other)
see if the update cols are different (e.g. last updated) |
java.lang.String |
xmlGetId()
set id key in db |
GroupType |
xmlRetrieveByIdOrKey()
retrieve from db by id or key. |
GroupType |
xmlSaveBusinessProperties(GroupType existingRecord)
save the business properties (not update properties) |
void |
xmlSaveUpdateProperties()
save the udpate properties (e.g. last updated). |
void |
xmlSetId(java.lang.String theId)
set id key in db |
XmlExportGroupType |
xmlToExportGroupType(GrouperVersion grouperVersion)
convert to xml bean for export |
java.lang.String |
xmlToString()
convert to string for log |
Methods inherited from class edu.internet2.middleware.grouper.GrouperAPI |
---|
dbVersionClear, dbVersionIsDifferent, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onSave, onUpdate, setHibernateVersionNumber |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TABLE_GROUPER_TYPES
public static final java.lang.String COLUMN_TYPE_UUID
public static final java.lang.String COLUMN_OLD_ID
public static final java.lang.String COLUMN_OLD_TYPE_UUID
public static final java.lang.String FIELD_CREATE_TIME
public static final java.lang.String FIELD_CREATOR_UUID
public static final java.lang.String FIELD_DB_VERSION
public static final java.lang.String FIELD_IS_ASSIGNABLE
public static final java.lang.String FIELD_IS_INTERNAL
public static final java.lang.String FIELD_NAME
public static final java.lang.String FIELD_UUID
public static final long serialVersionUID
Constructor Detail |
---|
public GroupType()
Method Detail |
---|
public static GroupType createType(GrouperSession s, java.lang.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
.
InsufficientPrivilegeException
SchemaException
public static GroupType createType(GrouperSession s, java.lang.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
.
InsufficientPrivilegeException
SchemaException
public java.lang.String getContextId()
public void setContextId(java.lang.String contextId1)
setContextId
in interface GrouperHasContext
contextId1
- public Field addAttribute(GrouperSession s, java.lang.String name, Privilege read, Privilege write, boolean required) 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.read
- Privilege
required to write to this Field
.write
- Privilege
required to write to this Field
.required
- Is this attribute required.
InsufficientPrivilegeException
SchemaException
public Field addAttribute(GrouperSession s, java.lang.String name, Privilege read, Privilege write, boolean required, 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.read
- Privilege
required to write to this Field
.write
- Privilege
required to write to this Field
.required
- Is this attribute required.exceptionIfExists
-
InsufficientPrivilegeException
SchemaException
public Field addOrUpdateAttribute(GrouperSession s, java.lang.String name, Privilege read, Privilege write, boolean required) 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.read
- Privilege
required to write to this Field
.write
- Privilege
required to write to this Field
.required
- Is this attribute required.
InsufficientPrivilegeException
SchemaException
public Field addList(GrouperSession s, java.lang.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
.
InsufficientPrivilegeException
SchemaException
public 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.
InsufficientPrivilegeException
SchemaException
public void deleteField(GrouperSession s, java.lang.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.
InsufficientPrivilegeException
SchemaException
public boolean isSystemType()
public static GroupType internal_createType(GrouperSession s, java.lang.String name, boolean isAssignable, boolean isInternal, boolean exceptionIfExists, boolean[] changed, java.lang.String uuid) throws InsufficientPrivilegeException, SchemaException
s
- name
- isAssignable
- isInternal
- exceptionIfExists
- changed
- boolean array, the fisrt index will be in it existed alreadyuuid
- to use or null for one to be assigned
InsufficientPrivilegeException
SchemaException
public Field internal_addField(GrouperSession s, java.lang.String name, FieldType type, Privilege read, Privilege write, boolean required, boolean exceptionIfExists, boolean updateIfExists, boolean[] changedArray, java.lang.String uuid) throws InsufficientPrivilegeException, SchemaException
s
- name
- type
- read
- write
- required
- exceptionIfExists
- updateIfExists
- changedArray
- is an array of 1 if you want to know if this method changed anything, else nulluuid
-
InsufficientPrivilegeException
SchemaException
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public long getCreateTime()
public java.lang.String getCreatorUuid()
public java.util.Set<Field> getFields()
public boolean getIsAssignable()
public boolean getIsInternal()
public java.lang.String getName()
public java.lang.String getUuid()
public int hashCode()
hashCode
in class java.lang.Object
public void setCreateTime(long createTime)
createTime
- public void setCreatorUuid(java.lang.String creatorUUID)
creatorUUID
- public void setFields(java.util.Set fields)
fields
- public void setIsAssignable(boolean isAssignable)
isAssignable
- public void setIsInternal(boolean isInternal)
isInternal
- public void setName(java.lang.String name)
name
- public void setUuid(java.lang.String uuid)
uuid
- public java.lang.String toString()
toString
in class java.lang.Object
public void onPostDelete(HibernateSession hibernateSession)
HibGrouperLifecycle
onPostDelete
in interface HibGrouperLifecycle
onPostDelete
in class GrouperAPI
GrouperAPI.onPostDelete(edu.internet2.middleware.grouper.hibernate.HibernateSession)
public void onPostSave(HibernateSession hibernateSession)
HibGrouperLifecycle
onPostSave
in interface HibGrouperLifecycle
onPostSave
in class GrouperAPI
GrouperAPI.onPostSave(edu.internet2.middleware.grouper.hibernate.HibernateSession)
public void onPostUpdate(HibernateSession hibernateSession)
HibGrouperLifecycle
onPostUpdate
in interface HibGrouperLifecycle
onPostUpdate
in class GrouperAPI
GrouperAPI.onPostUpdate(edu.internet2.middleware.grouper.hibernate.HibernateSession)
public void onPreDelete(HibernateSession hibernateSession)
HibGrouperLifecycle
onPreDelete
in interface HibGrouperLifecycle
onPreDelete
in class GrouperAPI
GrouperAPI.onPreDelete(edu.internet2.middleware.grouper.hibernate.HibernateSession)
public void onPreSave(HibernateSession hibernateSession)
HibGrouperLifecycle
onPreSave
in interface HibGrouperLifecycle
onPreSave
in class GrouperAPI
GrouperAPI.onPreSave(edu.internet2.middleware.grouper.hibernate.HibernateSession)
public void onPreUpdate(HibernateSession hibernateSession)
HibGrouperLifecycle
onPreUpdate
in interface HibGrouperLifecycle
onPreUpdate
in class GrouperAPI
GrouperAPI.onPreUpdate(edu.internet2.middleware.grouper.hibernate.HibernateSession)
public GroupType dbVersion()
dbVersion
in class GrouperAPI
public java.util.Set<java.lang.String> dbVersionDifferentFields()
dbVersionDifferentFields
in class GrouperAPI
GrouperAPI.dbVersionDifferentFields()
public void dbVersionReset()
dbVersionReset
in class GrouperAPI
public GroupType clone()
clone
in interface GrouperCloneable
clone
in class GrouperAPI
Object.clone()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
Comparable.compareTo(java.lang.Object)
public void store()
public void xmlCopyBusinessPropertiesToExisting(GroupType existingRecord)
XmlImportableBase
xmlCopyBusinessPropertiesToExisting
in interface XmlImportableBase<GroupType>
XmlImportableBase.xmlCopyBusinessPropertiesToExisting(java.lang.Object)
public boolean xmlDifferentBusinessProperties(GroupType other)
XmlImportableBase
xmlDifferentBusinessProperties
in interface XmlImportableBase<GroupType>
other
- the one to compare with
XmlImportableBase.xmlDifferentBusinessProperties(java.lang.Object)
public boolean xmlDifferentUpdateProperties(GroupType other)
XmlImportableBase
xmlDifferentUpdateProperties
in interface XmlImportableBase<GroupType>
other
- the one to compare with
XmlImportableBase.xmlDifferentUpdateProperties(java.lang.Object)
public GroupType xmlRetrieveByIdOrKey()
XmlImportable
xmlRetrieveByIdOrKey
in interface XmlImportable<GroupType>
XmlImportable.xmlRetrieveByIdOrKey()
public GroupType xmlSaveBusinessProperties(GroupType existingRecord)
XmlImportableBase
xmlSaveBusinessProperties
in interface XmlImportableBase<GroupType>
existingRecord
- null if insert, the object if exists in DB
generally just copy the hibernate version number, and last updated to the
object and store it
XmlImportableBase.xmlSaveBusinessProperties(java.lang.Object)
public void xmlSaveUpdateProperties()
XmlImportableBase
xmlSaveUpdateProperties
in interface XmlImportableBase<GroupType>
XmlImportableBase.xmlSaveUpdateProperties()
public XmlExportGroupType xmlToExportGroupType(GrouperVersion grouperVersion)
grouperVersion
-
public java.lang.String xmlGetId()
XmlImportableBase
xmlGetId
in interface XmlImportableBase<GroupType>
XmlImportableBase.xmlGetId()
public void xmlSetId(java.lang.String theId)
XmlImportableBase
xmlSetId
in interface XmlImportableBase<GroupType>
XmlImportableBase.xmlSetId(java.lang.String)
public java.lang.String xmlToString()
XmlImportableBase
xmlToString
in interface XmlImportableBase<GroupType>
XmlImportableBase.xmlToString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |