edu.internet2.middleware.grouper.attr
Class AttributeDefScope

java.lang.Object
  extended by edu.internet2.middleware.grouper.GrouperAPI
      extended by edu.internet2.middleware.grouper.attr.AttributeDefScope
All Implemented Interfaces:
HibGrouperLifecycle, Hib3GrouperVersioned, GrouperCloneable, GrouperHasContext, GrouperUtil.FieldValuable, XmlImportableBase<AttributeDefScope>, XmlImportableMultiple<AttributeDefScope>, Serializable, org.hibernate.classic.Lifecycle

public class AttributeDefScope
extends GrouperAPI
implements GrouperHasContext, Hib3GrouperVersioned, XmlImportableMultiple<AttributeDefScope>

clamp down an attribute def to a set of scopes which are like strings in the DB. could be a group/stem name, or

Author:
mchyzer
See Also:
Serialized Form

Field Summary
static String COLUMN_ATTRIBUTE_DEF_ID
          column
static String COLUMN_ATTRIBUTE_DEF_SCOPE_TYPE
          column
static String COLUMN_CONTEXT_ID
          column
static String COLUMN_CREATED_ON
          column
static String COLUMN_ID
          column
static String COLUMN_LAST_UPDATED
          column
static String COLUMN_SCOPE_STRING
          column
static String COLUMN_SCOPE_STRING2
          column
static String FIELD_ATTRIBUTE_DEF_ID
          constant for field name for: attributeDefId
static String FIELD_ATTRIBUTE_DEF_SCOPE_TYPE
          constant for field name for: attributeDefScopeType
static String FIELD_CONTEXT_ID
          constant for field name for: contextId
static String FIELD_CREATED_ON_DB
          constant for field name for: createdOnDb
static String FIELD_ID
          constant for field name for: id
static String FIELD_LAST_UPDATED_DB
          constant for field name for: lastUpdatedDb
static String FIELD_SCOPE_STRING
          constant for field name for: scopeString
static String FIELD_SCOPE_STRING2
          constant for field name for: scopeString2
static String TABLE_GROUPER_ATTRIBUTE_DEF_SCOPE
          name of the groups attribute def table in the db
 
Fields inherited from class edu.internet2.middleware.grouper.GrouperAPI
COLUMN_HIBERNATE_VERSION_NUMBER, FIELD_DB_VERSION, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER
 
Fields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO
 
Constructor Summary
AttributeDefScope()
           
 
Method Summary
 AttributeDefScope clone()
          deep clone the fields in this object
 void delete()
          Delete this group from the Groups Registry.
 String getAttributeDefId()
          id of the attribute def
 AttributeDefScopeType getAttributeDefScopeType()
          type of scope
 String getAttributeDefScopeTypeDb()
          type of scope
 String getContextId()
          context id of the transaction
 Timestamp getCreatedOn()
          when created
 Long getCreatedOnDb()
          when created
 String getId()
          id of this scope
 Timestamp getLastUpdated()
          when last updated
 Long getLastUpdatedDb()
          when last updated
 String getScopeString()
          scope string, either a group or stem name or like string or something
 String getScopeString2()
          scope string information 2 (whatever it is used for)
 void onPreSave(HibernateSession hibernateSession)
          before a save (insert) occurs
 void onPreUpdate(HibernateSession hibernateSession)
          before an update occurs
 void saveOrUpdate()
          save or update this object
 void setAttributeDefId(String attributeDefId1)
          id of the attribute def
 void setAttributeDefScopeType(AttributeDefScopeType attributeDefScopeType1)
          type of scope
 void setAttributeDefScopeTypeDb(String theAttributeDefScopeType1)
          type of scope
 void setContextId(String contextId1)
          context id of the transaction
 void setCreatedOn(Timestamp createdOn1)
          when created
 void setCreatedOnDb(Long createdOn1)
          when created
 void setId(String id1)
          id of this scope
 void setLastUpdated(Timestamp lastUpdated1)
          when last updated
 void setLastUpdatedDb(Long lastUpdated1)
          when last updated
 void setScopeString(String scopeString1)
          scope string, either a group or stem name or like string or something
 void setScopeString2(String scopeString2)
          scope string information 2 (whatever it is used for)
 String toString()
           
 void xmlCopyBusinessPropertiesToExisting(AttributeDefScope existingRecord)
          copy business (non update) properties to an existing record
 boolean xmlDifferentBusinessProperties(AttributeDefScope other)
          see if the non update cols are different (e.g.
 boolean xmlDifferentUpdateProperties(AttributeDefScope other)
          see if the update cols are different (e.g.
 String xmlGetId()
          set id key in db
 AttributeDefScope xmlRetrieveByIdOrKey(Collection<String> idsToIgnore)
          retrieve from db by id or key.
 AttributeDefScope xmlSaveBusinessProperties(AttributeDefScope existingRecord)
          save the business properties (not update properties)
 void xmlSaveUpdateProperties()
          save the udpate properties (e.g.
 void xmlSetId(String theId)
          set id key in db
 XmlExportAttributeDefScope xmlToExportAttributeDefScope(GrouperVersion grouperVersion)
          convert to xml bean for export
 String xmlToString()
          convert to string for log
 
Methods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersion, dbVersionClear, dbVersionDifferentFields, dbVersionIsDifferent, dbVersionReset, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onPostDelete, onPostSave, onPostUpdate, onPreDelete, onSave, onUpdate, setHibernateVersionNumber
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TABLE_GROUPER_ATTRIBUTE_DEF_SCOPE

public static final String TABLE_GROUPER_ATTRIBUTE_DEF_SCOPE
name of the groups attribute def table in the db

See Also:
Constant Field Values

COLUMN_CONTEXT_ID

public static final String COLUMN_CONTEXT_ID
column

See Also:
Constant Field Values

COLUMN_CREATED_ON

public static final String COLUMN_CREATED_ON
column

See Also:
Constant Field Values

COLUMN_LAST_UPDATED

public static final String COLUMN_LAST_UPDATED
column

See Also:
Constant Field Values

COLUMN_ID

public static final String COLUMN_ID
column

See Also:
Constant Field Values

COLUMN_ATTRIBUTE_DEF_ID

public static final String COLUMN_ATTRIBUTE_DEF_ID
column

See Also:
Constant Field Values

COLUMN_ATTRIBUTE_DEF_SCOPE_TYPE

public static final String COLUMN_ATTRIBUTE_DEF_SCOPE_TYPE
column

See Also:
Constant Field Values

COLUMN_SCOPE_STRING

public static final String COLUMN_SCOPE_STRING
column

See Also:
Constant Field Values

COLUMN_SCOPE_STRING2

public static final String COLUMN_SCOPE_STRING2
column

See Also:
Constant Field Values

FIELD_ATTRIBUTE_DEF_ID

public static final String FIELD_ATTRIBUTE_DEF_ID
constant for field name for: attributeDefId

See Also:
Constant Field Values

FIELD_ATTRIBUTE_DEF_SCOPE_TYPE

public static final String FIELD_ATTRIBUTE_DEF_SCOPE_TYPE
constant for field name for: attributeDefScopeType

See Also:
Constant Field Values

FIELD_CONTEXT_ID

public static final String FIELD_CONTEXT_ID
constant for field name for: contextId

See Also:
Constant Field Values

FIELD_CREATED_ON_DB

public static final String FIELD_CREATED_ON_DB
constant for field name for: createdOnDb

See Also:
Constant Field Values

FIELD_ID

public static final String FIELD_ID
constant for field name for: id

See Also:
Constant Field Values

FIELD_LAST_UPDATED_DB

public static final String FIELD_LAST_UPDATED_DB
constant for field name for: lastUpdatedDb

See Also:
Constant Field Values

FIELD_SCOPE_STRING

public static final String FIELD_SCOPE_STRING
constant for field name for: scopeString

See Also:
Constant Field Values

FIELD_SCOPE_STRING2

public static final String FIELD_SCOPE_STRING2
constant for field name for: scopeString2

See Also:
Constant Field Values
Constructor Detail

AttributeDefScope

public AttributeDefScope()
Method Detail

getId

public String getId()
id of this scope

Returns:
id

setId

public void setId(String id1)
id of this scope

Parameters:
id1 -

getScopeString

public String getScopeString()
scope string, either a group or stem name or like string or something

Returns:
scope string

setScopeString

public void setScopeString(String scopeString1)
scope string, either a group or stem name or like string or something

Parameters:
scopeString1 -

getAttributeDefId

public String getAttributeDefId()
id of the attribute def

Returns:
the id

setAttributeDefId

public void setAttributeDefId(String attributeDefId1)
id of the attribute def

Parameters:
attributeDefId1 -

getAttributeDefScopeType

public AttributeDefScopeType getAttributeDefScopeType()
type of scope

Returns:
the type of scope

setAttributeDefScopeType

public void setAttributeDefScopeType(AttributeDefScopeType attributeDefScopeType1)
type of scope

Parameters:
attributeDefScopeType1 -

getAttributeDefScopeTypeDb

public String getAttributeDefScopeTypeDb()
type of scope

Returns:
the type of scope

setAttributeDefScopeTypeDb

public void setAttributeDefScopeTypeDb(String theAttributeDefScopeType1)
type of scope

Parameters:
theAttributeDefScopeType1 -

getScopeString2

public String getScopeString2()
scope string information 2 (whatever it is used for)

Returns:
the scopeString2

setScopeString2

public void setScopeString2(String scopeString2)
scope string information 2 (whatever it is used for)

Parameters:
scopeString2 - the scopeString2 to set

saveOrUpdate

public void saveOrUpdate()
save or update this object


getCreatedOnDb

public Long getCreatedOnDb()
when created

Returns:
timestamp

getCreatedOn

public Timestamp getCreatedOn()
when created

Returns:
timestamp

getLastUpdated

public Timestamp getLastUpdated()
when last updated

Returns:
timestamp

getLastUpdatedDb

public Long getLastUpdatedDb()
when last updated

Returns:
timestamp

setCreatedOn

public void setCreatedOn(Timestamp createdOn1)
when created

Parameters:
createdOn1 -

setCreatedOnDb

public void setCreatedOnDb(Long createdOn1)
when created

Parameters:
createdOn1 -

setLastUpdated

public void setLastUpdated(Timestamp lastUpdated1)
when last updated

Parameters:
lastUpdated1 -

setLastUpdatedDb

public void setLastUpdatedDb(Long lastUpdated1)
when last updated

Parameters:
lastUpdated1 -

setContextId

public void setContextId(String contextId1)
context id of the transaction

Specified by:
setContextId in interface GrouperHasContext
Parameters:
contextId1 -

clone

public AttributeDefScope clone()
deep clone the fields in this object

Specified by:
clone in interface GrouperCloneable
Specified by:
clone in class GrouperAPI
Returns:
the clone of the object
See Also:
Object.clone()

getContextId

public String getContextId()
context id of the transaction

Returns:
context id

xmlCopyBusinessPropertiesToExisting

public void xmlCopyBusinessPropertiesToExisting(AttributeDefScope existingRecord)
Description copied from interface: XmlImportableBase
copy business (non update) properties to an existing record

Specified by:
xmlCopyBusinessPropertiesToExisting in interface XmlImportableBase<AttributeDefScope>
See Also:
XmlImportableBase.xmlCopyBusinessPropertiesToExisting(java.lang.Object)

xmlDifferentBusinessProperties

public boolean xmlDifferentBusinessProperties(AttributeDefScope other)
Description copied from interface: XmlImportableBase
see if the non update cols are different (e.g. name)

Specified by:
xmlDifferentBusinessProperties in interface XmlImportableBase<AttributeDefScope>
Parameters:
other - the one to compare with
Returns:
true if so
See Also:
XmlImportableBase.xmlDifferentBusinessProperties(java.lang.Object)

xmlDifferentUpdateProperties

public boolean xmlDifferentUpdateProperties(AttributeDefScope other)
Description copied from interface: XmlImportableBase
see if the update cols are different (e.g. last updated)

Specified by:
xmlDifferentUpdateProperties in interface XmlImportableBase<AttributeDefScope>
Parameters:
other - the one to compare with
Returns:
true if so
See Also:
XmlImportableBase.xmlDifferentUpdateProperties(java.lang.Object)

xmlSaveBusinessProperties

public AttributeDefScope xmlSaveBusinessProperties(AttributeDefScope existingRecord)
Description copied from interface: XmlImportableBase
save the business properties (not update properties)

Specified by:
xmlSaveBusinessProperties in interface XmlImportableBase<AttributeDefScope>
Parameters:
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
Returns:
the new object or existing
See Also:
XmlImportableBase.xmlSaveBusinessProperties(java.lang.Object)

xmlSaveUpdateProperties

public void xmlSaveUpdateProperties()
Description copied from interface: XmlImportableBase
save the udpate properties (e.g. last updated). Note, this is done with a sql update statement, not with hibernate

Specified by:
xmlSaveUpdateProperties in interface XmlImportableBase<AttributeDefScope>
See Also:
XmlImportableBase.xmlSaveUpdateProperties()

xmlRetrieveByIdOrKey

public AttributeDefScope xmlRetrieveByIdOrKey(Collection<String> idsToIgnore)
Description copied from interface: XmlImportableMultiple
retrieve from db by id or key. throws exception if duplicate

Specified by:
xmlRetrieveByIdOrKey in interface XmlImportableMultiple<AttributeDefScope>
Parameters:
idsToIgnore - these are ids already processed, do not pick these
Returns:
the object or null if not found
See Also:
XmlImportableMultiple.xmlRetrieveByIdOrKey(java.util.Collection)

xmlToExportAttributeDefScope

public XmlExportAttributeDefScope xmlToExportAttributeDefScope(GrouperVersion grouperVersion)
convert to xml bean for export

Parameters:
grouperVersion -
Returns:
xml bean

xmlGetId

public String xmlGetId()
Description copied from interface: XmlImportableBase
set id key in db

Specified by:
xmlGetId in interface XmlImportableBase<AttributeDefScope>
Returns:
id
See Also:
XmlImportableBase.xmlGetId()

xmlSetId

public void xmlSetId(String theId)
Description copied from interface: XmlImportableBase
set id key in db

Specified by:
xmlSetId in interface XmlImportableBase<AttributeDefScope>
See Also:
XmlImportableBase.xmlSetId(java.lang.String)

xmlToString

public String xmlToString()
Description copied from interface: XmlImportableBase
convert to string for log

Specified by:
xmlToString in interface XmlImportableBase<AttributeDefScope>
Returns:
the string value for log
See Also:
XmlImportableBase.xmlToString()

delete

public void delete()
            throws GroupDeleteException,
                   InsufficientPrivilegeException
Delete this group from the Groups Registry.
 try {
   g.delete();
 }
 catch (GroupDeleteException e0) {
   // Unable to delete group
 }
 catch (InsufficientPrivilegeException e1) {
   // Not privileged to delete this group
 }
 

Throws:
GroupDeleteException
InsufficientPrivilegeException

onPreSave

public void onPreSave(HibernateSession hibernateSession)
Description copied from interface: HibGrouperLifecycle
before a save (insert) occurs

Specified by:
onPreSave in interface HibGrouperLifecycle
Overrides:
onPreSave in class GrouperAPI
See Also:
GrouperAPI.onPreSave(edu.internet2.middleware.grouper.hibernate.HibernateSession)

onPreUpdate

public void onPreUpdate(HibernateSession hibernateSession)
Description copied from interface: HibGrouperLifecycle
before an update occurs

Specified by:
onPreUpdate in interface HibGrouperLifecycle
Overrides:
onPreUpdate in class GrouperAPI
See Also:
GrouperAPI.onPreUpdate(edu.internet2.middleware.grouper.hibernate.HibernateSession)

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()