/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
*
* 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
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/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 Copyrighted [year] [name of copyright owner]"
*
* $Id: ConfigureServerXMLTask.java,v 1.2 2008/11/28 12:36:21 saueree Exp $
*/
/*
* Portions Copyrighted 2011-2013 ForgeRock AS
*/
"TSK_MSG_CONFIGURE_SERVER_XML_EXECUTE";
"TSK_MSG_CONFIGURE_SERVER_XML_ROLLBACK";
public boolean execute(
boolean status = false;
try {
// add the Agent realm
"ConfigureServerXMLTask.execute(): "
+ ex.getMessage(),
ex);
status = false;
}
return status;
}
private boolean configureRealm(
boolean result = false;
try {
.getChildElements();
if (serviceElement.getName()
int count = 0;
.getChildElements();
count++) {
count);
if (engineElement.getName()
ELEMENT_ENGINE)) {
boolean oldRealm = false;
boolean realmExists = false;
int realmIndex = 0;
.getChildElements();
for (int index = 0;
index++) {
// Check if there is a <Realm> as with new
// tomcat install
ELEMENT_REALM)) {
"ConfigureServerXMLtask." +
"configureRealm(): "
+ "Agent Realm already exists.");
realmExists = true;
break;
} else {
"ConfigureServerXMLtask." +
"configureRealm(): "
+ "There is a match for an " +
"existing element <Realm> !");
oldRealm = true;
realmIndex = index;
break;
}
}
}
if (oldRealm) {
"name"),
// save old data
result = true;
}
if (!realmExists) {
true);
}
result = true;
break;
}
}
"Agent was not configured for Service "
+ " since no engine element was found " +
"for the service");
}
}
}
"ConfigureServerXMLTask.configureRealm(): "
ex);
result = false;
}
return result;
}
Map properties) {
args);
return message;
}
Map properties) {
args);
return message;
}
public boolean rollBack(
boolean status = false;
return status;
}
}