com.ibm.pim.spec
Interface Spec

All Known Subinterfaces:
DestinationSpec, FileSpec, LookupSpec, PrimarySpec, ScriptInputSpec, SecondarySpec, SubSpec

public interface Spec

Interface for the generic Spec object

Since:
6.0.0

Nested Class Summary
static class Spec.Type
          Possible Spec types
 
Field Summary
static java.lang.String copyright
           
 
Method Summary
 void addLocale(java.util.Locale locale)
          Add the given locale to the list of existing locales of this spec
 AttributeDefinition createAttributeDefinition(java.lang.String path, int order)
          Create a new attribute definition under this spec.
 void delete()
          Delete a spec
 AttributeDefinition getAttributeDefinition(java.lang.String path)
          Return a specific AttributeDefinition by path, null if no AttributeDefinition with the given path is found.
 java.util.List<AttributeDefinition> getAttributeDefinitions()
          Returns all Attribute Definitions of this Spec at all levels, an empty collection if none are present.
 java.util.Collection<java.util.Locale> getLocales()
          Returns all associated Locales if this Spec is localized
 java.lang.String getName()
          Returns the Spec Name
 AttributeDefinition getRootAttributeDefinition()
          Returns the root attribute definition for the Spec.
The root attribute definition is a virtual root of the tree of attribute definitions belonging to the spec.
 Spec.Type getType()
          Get the spec type
 boolean isLocalized()
          Identify whether this Spec is localized
 void removeAttributeDefinition(java.lang.String path)
          Remove an attribute definition, returns null if attribute definition with the given path is not found
 void removeLocale(java.util.Locale locale)
          Removes the given locale from this spec.
 void replaceLocales(java.util.Collection<java.util.Locale> locales)
          Removes all of the the existing locales and sets the new ones passed to this method
 void save()
          Save a spec
 void setLocalized(boolean localized)
          Sets the localized property of this spec
 

Field Detail

copyright

static final java.lang.String copyright
See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Returns the Spec Name

Returns:
The name of this Spec
Throws:
PIMInternalException - If an internal error occurs

getAttributeDefinitions

java.util.List<AttributeDefinition> getAttributeDefinitions()
Returns all Attribute Definitions of this Spec at all levels, an empty collection if none are present. Note that this method doesn't return the root node. Sub-level attribute definitions of a grouping type are returned.

Returns:
A collection of AttributeDefinition objects.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use

getAttributeDefinition

AttributeDefinition getAttributeDefinition(java.lang.String path)
Return a specific AttributeDefinition by path, null if no AttributeDefinition with the given path is found.

Parameters:
path - Complete node path in the format /
Returns:
A AttributeDefinition object, exception if no match.
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If null or empty path is passed
PIMAuthorizationException - Reserved for future use

getRootAttributeDefinition

AttributeDefinition getRootAttributeDefinition()
Returns the root attribute definition for the Spec.
The root attribute definition is a virtual root of the tree of attribute definitions belonging to the spec. It can be used to traverse down the attribute definition tree for the spec.

Returns:
An AttributeDefinition object
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use

isLocalized

boolean isLocalized()
Identify whether this Spec is localized

Returns:
true if this Spec is localized.
Throws:
PIMInternalException - If an internal error occurs

getLocales

java.util.Collection<java.util.Locale> getLocales()
Returns all associated Locales if this Spec is localized

Returns:
a java.util.Collection of Locale objects, or an empty collection if not Localized
Throws:
PIMInternalException - If an internal error occurs

createAttributeDefinition

AttributeDefinition createAttributeDefinition(java.lang.String path,
                                              int order)
Create a new attribute definition under this spec. This node is always added at the end of existing nodes.

Parameters:
path - attribute definition path, can be a composite path
order - Position where the new attribute definition should get added. If there is a already an attribute definition at the given position, new attribute definition is added prior to the existing node. There can be holes in the order values specified, attribute definitions are added according to their relative order within the spec tree.
Returns:
AttributeDefinition object
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If null or empty path is passed
PIMAuthorizationException - If the user does not have the equivalent of SystemWideAccessPrivilege.SPEC_MODIFY_SPEC

save

void save()
Save a spec

Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the user does not have the equivalent of SystemWideAccessPrivilege.SPEC_MODIFY_SPEC

addLocale

void addLocale(java.util.Locale locale)
Add the given locale to the list of existing locales of this spec

Parameters:
locale - a locale to be added
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If the locale passed in is Null or is not part of the available locales for the company
java.lang.UnsupportedOperationException - If this spec is not localized
PIMAuthorizationException - If the user does not have the equivalent of SystemWideAccessPrivilege.SPEC_MODIFY_SPEC

replaceLocales

void replaceLocales(java.util.Collection<java.util.Locale> locales)
Removes all of the the existing locales and sets the new ones passed to this method

Parameters:
locales - a collection of locales to be added
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If the collection of locales passed in is Null/empty or is not part of the available locales for the company
java.lang.UnsupportedOperationException - If this spec is not localized
PIMAuthorizationException - If the user does not have the equivalent of SystemWideAccessPrivilege.SPEC_MODIFY_SPEC

removeLocale

void removeLocale(java.util.Locale locale)
Removes the given locale from this spec. Throws exception locale not doesn’t exist in the list of locales associated to this spec.

Parameters:
locale - a locale to be removed
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If the locale passed in is Null or is not part of the available locales for the company
java.lang.UnsupportedOperationException - If this spec is not localized
PIMAuthorizationException - If the user does not have the equivalent of SystemWideAccessPrivilege.SPEC_MODIFY_SPEC

setLocalized

void setLocalized(boolean localized)
Sets the localized property of this spec

Parameters:
localized - boolean Flag that enables localization on this spec
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the user does not have the equivalent of SystemWideAccessPrivilege.SPEC_MODIFY_SPEC

removeAttributeDefinition

void removeAttributeDefinition(java.lang.String path)
Remove an attribute definition, returns null if attribute definition with the given path is not found

Parameters:
path - full path to the attribute definition
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If null or empty path is passed
PIMAuthorizationException - If the user does not have the equivalent of SystemWideAccessPrivilege.SPEC_MODIFY_SPEC

delete

void delete()
Delete a spec

Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the user does not have the equivalent of SystemWideAccessPrivilege.SPEC_MODIFY_SPEC

getType

Spec.Type getType()
Get the spec type

Returns:
SpecType enumeration
Throws:
PIMInternalException - If an internal error occurs