/** * Returns a (single) secondary identifier. * * This method returns a property that acts as an secondary identifier for * the resource object. Secondary identifiers are used to confirm primary * identification of resource object. * * Returns null if no secondary identifier is defined. * * Resource objects may have multiple (composite) identifiers, but this * method assumes that there is only a single identifier. The method will * throw exception if that assumption is not satisfied. * * @return secondary identifier property * @throws IllegalStateException * if resource object has multiple secondary identifiers */ @Override public <T> PrismProperty<T> getSecondaryIdentifier() { Collection<ResourceAttribute<?>> secondaryIdentifiers = getSecondaryIdentifiers(); if (secondaryIdentifiers.size() > 1){ throw new IllegalStateException("Resource object has more than one identifier."); } for (PrismProperty<?> p : secondaryIdentifiers){ return (PrismProperty<T>) p; } return null; }