Package com.opencloud.slee.profile
Class ProfileDataCollection.Profile
- java.lang.Object
-
- com.opencloud.slee.profile.ProfileDataCollection.Profile
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- ProfileDataCollection
public static final class ProfileDataCollection.Profile extends Object implements Serializable
Class representing a profile.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProfileDataCollection.Profile.Action
Management actions that can be performed with aProfileDataCollection.Profile
object.
-
Constructor Summary
Constructors Constructor Description Profile(String profileName)
Create a new profile import record.Profile(String profileName, ProfileDataCollection.Profile.Action action, boolean failIfExists, boolean failIfNotExists)
Create a new profile import record.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttributeValue(String attrName, ProfileDataCollection.AttributeValue attrValue)
Add an attribute value to this profile.boolean
failIfExists()
Determine if the fail-if-exists flag has been set for CREATE actions.boolean
failIfNotExists()
Determine if the fail-if-not-exists flag has been set for REMOVE actions.ProfileDataCollection.Profile.Action
getAction()
Get the action to be applied to the profile.String
getName()
Get the name of the profile.Map<String,ProfileDataCollection.AttributeValue>
getValues()
Get the attribute names and values for this profile.String
toString()
-
-
-
Constructor Detail
-
Profile
public Profile(String profileName)
Create a new profile import record. The profile action is CREATE, and errors are ignored. <p> This constructor is equivalent to
new Profile(profileName, CREATE, false, false)
.- Parameters:
profileName
- the name of the profile. The valuenull
is acceptable and indicates the profile table’s default profile.
-
Profile
public Profile(String profileName, ProfileDataCollection.Profile.Action action, boolean failIfExists, boolean failIfNotExists)
Create a new profile import record.
- Parameters:
profileName
- the name of the profile. The valuenull
is acceptable and indicates the profile table’s default profile.action
- the import action. Must be one of the constants defined by theProfileDataCollection.Profile.Action
enumeration.failIfExists
- flag indicating if an exception should be thrown during import ifaction == CREATE
and a profile with the name specified byprofileName
already exists.failIfNotExists
- flag indicating if an exception should be thrown during import ifaction == REMOVE
and a profile with the name specified byprofileName
does not exist.- Throws:
IllegalArgumentException
- if an invalidaction
is specified, iffailIfExists
istrue
butaction != CREATE
iffailIfNotExists
istrue
butaction != remove
, or if the default profile is selected for removal.
-
-
Method Detail
-
getName
public String getName()
Get the name of the profile.
- Returns:
- the name of the profile.
-
getAction
public ProfileDataCollection.Profile.Action getAction()
Get the action to be applied to the profile.
- Returns:
- the action.
-
failIfExists
public boolean failIfExists()
Determine if the fail-if-exists flag has been set for CREATE actions.
- Returns:
true
if the fail-if-exists flag has been set,false
otherwise.
-
failIfNotExists
public boolean failIfNotExists()
Determine if the fail-if-not-exists flag has been set for REMOVE actions.
- Returns:
true
if the fail-if-not-exists flag has been set,false
otherwise.
-
addAttributeValue
public void addAttributeValue(String attrName, ProfileDataCollection.AttributeValue attrValue)
Add an attribute value to this profile.
- Parameters:
attrName
- the name of the attribute.attrValue
- the value of the attribute.- Throws:
IllegalStateException
- if the action for this profile is REMOVE.IllegalArgumentException
- if a value for the given attribute has already been specified for this profile.
-
getValues
public Map<String,ProfileDataCollection.AttributeValue> getValues()
Get the attribute names and values for this profile.
- Returns:
- a map of attribute name to
attribute value
.
-
-