/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 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: UserDiscoEntryHandler.java,v 1.2 2008/06/25 05:49:56 qcheng Exp $
*
*/
/*
* The class <code>UserDiscoEntryHandler</code> provides a default
* implementation for interface <code>DiscoEntryHandler</code>.
* <p>
* entry in attribute named "sunIdentityServerDiscoEntries".
*/
"sunIdentityServerDiscoEntries";
/**
* Default Constructor.
*/
public UserDiscoEntryHandler() {
"in UserDiscoEntryHandler.constructor");
}
/**
* Finds discovery entries for a user under user entry.
* @param userID The user whose discovery entries will be returned.
* @param reqServiceTypes List of
* <code>com.sun.identity.liberty.ws.disco.jaxb.RequestedServiceType</code>
* objects from discovery query.
* @return Map of <code>entryId</code> and
* <code>com.sun.identity.liberty.ws.disco.plugins.jaxb.DiscoEntryElement
* </code> for this user. For each <code>DiscoEntry</code> element in the
* List, the <code>entryId</code> attribute of ResourceOffering need to
* be set.
*/
"in UserDiscoEntryHandler.getDiscoEntries");
try {
{
// this is the case when the DiscoEntry is set through console
// or amadmin, and entryID was not set
{
"UserDiscoEntryHandler.getDiscoEntries: " +
"couldn't set missing entryID to entry.");
}
}
} catch (Exception e) {
"UserDiscoEntryHandler.getDiscoEntries:", e);
}
return results;
}
/**
* Modifies discovery entries for a user.
* @param userID The user whose discovery entries will be set.
* @param removes List of
* <code>com.sun.identity.liberty.ws.disco.jaxb.RemoveEntryType</code>
* jaxb objects.
* @param inserts List of
* <code>com.sun.identity.liberty.ws.disco.jaxb.InsertEntryType</code>
* jaxb objects.
* @return Map which contains the following key value pairs:
* Key: <code>DiscoEntryHandler.STATUS_CODE</code>
* Value: status code String such as "OK", "Failed", etc.
* Key: <code>DiscoEntryHandler.NEW_ENTRY_IDS</code>
* Value: List of <code>entryIds</code> for the entries that were added.
* "OK", and there are <code>InsertEntry</code> elements in the modify
* request. When successful, all modification (removes and inserts) should
* be done. No partial changes should be done.
*/
"in UserDiscoEntryHandler.modifyDiscoEntries");
try {
} catch (Exception e) {
"UserDiscoEntryHandler.modifyDiscoEntries: Exception:", e);
return result;
}
"UserDiscoEntryHandler.modifyDiscoEntries: handling "
}
) {
return result;
}
}
"UserDiscoEntryHandler.modifyDiscoEntries: handling " +
}
) {
return result;
}
}
// so far everything is successful
{
"UserDiscoEntryHandler.modifyDiscoEntries: "
+ "couldn't set DiscoEntries through DiscoEntryHandler.");
return result;
} else {
"UserDiscoEntryHandler.modifyDisco"
+ "Entries: set DiscoEntries through DiscoEntryHandler "
+ "successfully.");
}
}
return result;
}
}
}