Hi sailors,
Custom objects are really useful and important part in IdentityIQ. You can use them as properties holders or independent objects, in other words: customer decides 'what', 'when' and 'why' to use it.
There are 2 main parts of custom object:
After implementing (all rule`s types) generating rule`s xmls from java classes (article in LinkedIn, GitHub project) the custom objects were next. Aims:
To implement java class -> custom xml the following objects were added:
There are 2 main annotations:
The most important part is generation xml. As for name it is not really interesting, but as for attributes and with values -it is not so trivial. Annotation can have only constant types as properties and as values uses String. For generation the current type uses type of a field in an java class and the XMLSerializer from identityiq.jar, so we can use all supported types for properties. But using annotations has several limitations:
AbstractCustomObject
This is a super class for all java-based custom objects. Ii contains the following functionality:
You can override them and add some additional stuff (e.g.): loading a transient property (identity) according to an annotated string field identityName.
Uses for loading/creating java-based custom object.
Java class source:
/** * Test class for simple custom object */ @Data @Custom("Test simple custom object") public class SimpleCustomObject extends AbstractCustomObject { /** * Test string value */ @Attribute(@AttributeValue("single")) private String stringValue; /** * Test string value as collection */ @Attribute(@AttributeValue("stringCollection")) private List<String> stringCollection; /** * Test strings values */ @Attribute({ @AttributeValue("string1"), @AttributeValue("string2") }) private List<String> stringsCollectionNatural; /** * Test boolean value */ @Attribute(@AttributeValue("true")) private Boolean booleanValue; /** * Test long value */ @Attribute(@AttributeValue("5")) private Long longValue; /** * Test date value */ @Attribute(@AttributeValue("02/15/2019 10:35:45")) private Date dateValue; /** * Test date map */ @Attribute({ @AttributeValue(key = "now", value = "now"), @AttributeValue(key = "02/15/2019 10:35:45", value = "02/15/2019 10:35:45") }) private Map<String, Date> dateMap; /** * Test boolean map */ @Attribute({ @AttributeValue(key = "false", value = "false"), @AttributeValue(key = "true", value = "true") }) private Map<String, Boolean> booleanMap; /** * Test set of string */ @Attribute({ @AttributeValue(value = "1"), @AttributeValue(value = "2"), @AttributeValue(value = "1") }) private Set<String> setValue; /** * Test attribute name */ @Attribute(name = "attributeName", value = @AttributeValue("nameTest")) private String fieldName; /** * Test transient attribute name */ private String transientField; }
Output xml:
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE Custom PUBLIC "sailpoint.dtd" "sailpoint.dtd"> <Custom name="Test simple custom object"> <Attributes> <Map> <entry key="attributeName" value="nameTest"/> <entry key="booleanMap"> <value> <Map> <entry key="false"> <value> <Boolean></Boolean> </value> </entry> <entry key="true"> <value> <Boolean>true</Boolean> </value> </entry> </Map> </value> </entry> <entry key="booleanValue"> <value> <Boolean>true</Boolean> </value> </entry> <entry key="dateMap"> <value> <Map> <entry key="02/15/2019 10:35:45"> <value> <Date>1550223345000</Date> </value> </entry> <entry key="now"> <value> <Date>1564044670418</Date> </value> </entry> </Map> </value> </entry> <entry key="dateValue"> <value> <Date>1550223345000</Date> </value> </entry> <entry key="longValue"> <value> <Long>5</Long> </value> </entry> <entry key="setValue"> <value> <Set> <String>1</String> <String>2</String> </Set> </value> </entry> <entry key="stringCollection"> <value> <List> <String>stringCollection</String> </List> </value> </entry> <entry key="stringValue" value="single"/> <entry key="stringsCollectionNatural"> <value> <List> <String>string1</String> <String>string2</String> </List> </value> </entry> </Map> </Attributes> <Description>Test class for simple custom object</Description> </Custom>
Just calling: CustomObjectFactory.load(SimpleCustomObject.class) will return an instance of SimpleCustomObject with all properties.
Using this approach with custom object gives us:
All sources are in GitHub project.
Thank you and I hope this article was useful for you.
This is really cool stuff, nice work
Could you please suggest me the document where I could find java packages developed by SailPoint and description of each package along with its classes, interfaces, methods with examples, elaborating its use.
?
Please go the below path then you can able to find all details.
C:\TOMCAT_HOME\webapps\identityiq\doc\javadoc
Thanks a lot.
My team would love to start using this for custom object interactions.
What jar provides these classes?
We are currently identityiq 8.0p2