UpgradeEntitlementSubConfigsStep.java revision 6d1d235433e402873f33b933020f25c11aa2b9ab
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014 ForgeRock AS.
*/
/**
* Upgrade step is responsible for updating existing application types with newly added actions.
*/
public class UpgradeEntitlementSubConfigsStep extends AbstractUpgradeStep {
private final EntitlementConfiguration entitlementService;
public UpgradeEntitlementSubConfigsStep() {
}
public void initialize() throws UpgradeException {
}
}
}
/**
* Compares the provided subconfig element's action list against what is currently present in the existing
* application type definition and captures the missing entries.
*
* @param subConfig The new application type's XML representation.
*/
if (applicationType != null) {
Map<String, Boolean> newActions = EntitlementUtils.getActions(parseAttributeValuePairTags(subConfig));
}
}
}
public boolean isApplicable() {
return !missingActions.isEmpty();
}
public void perform() throws UpgradeException {
if (!missingActions.isEmpty()) {
}
}
/**
* Adds the missing actions to their corresponding application type's.
*
* @throws UpgradeException If there was an error while updating the application type.
*/
private void addMissingActions() throws UpgradeException {
try {
if (DEBUG.messageEnabled()) {
}
} catch (EntitlementException ee) {
throw new UpgradeException(ee);
}
}
}
/**
* Retrieves the application type for the passed application type name.
*
* @param name
* the application type name
*
* @return an instance of ApplicationType associated with the name else null if the name is not present
*/
return type;
}
}
return null;
}
if (!missingActions.isEmpty()) {
}
}
if (!missingActions.isEmpty()) {
}
}
}
}
/**
* Retrieves the XML document for entitlements.
*
* @return a document instance representing entitlements
*
* @throws UpgradeException
* should an error occur attempting to read the entitlement xml
*/
try {
} finally {
}
return doc;
}
}