/**
* 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: GlobalDiscoEntryHandler.java,v 1.2 2008/06/25 05:49:56 qcheng Exp $
*
*/
/*
* The class <code>GlobalDiscoEntryHandler</code> provides an
* implementation for handling service registations in B2E case.
* <p>
*/
"sunIdentityServerDynamicDiscoEntries";
"sunIdentityServerDiscoveryService";
/**
* Default Constructor
*/
public GlobalDiscoEntryHandler() {
}
/**
* Returns the default realm identity object.
*/
throws DiscoveryException
{
try {
return idRepo.getRealmIdentity();
} catch (IdRepoException ire) {
"Identity: Initialization failed", ire);
} catch (SSOException se) {
"Identity: SSOException ", se);
}
}
/**
* This method registers the Discovery Service to the root realm if
* the service is not already registered.
*/
private static void registerDiscoveryService()
throws DiscoveryException {
try {
if(assignedServices != null &&
return;
}
} catch(IdRepoException ire) {
"DiscoveryService: Exception", ire);
} catch(SSOException se) {
"DiscoveryService: Exception", se);
}
}
/**
* Returns DiscoEntries for a user under userEntry.
* @param userID The user whose DiscoEntries will be returned.
* @param reqServiceTypes List of
* com.sun.identity.liberty.ws.disco.jaxb.RequestedServiceType
* objects from discovery Query.
* @return Map of entryId and
* com.sun.identity.liberty.ws.disco.plugins.jaxb.DiscoEntryElement
* for this user. For each DiscoEntry element in the List,
* the entryId attribute of ResourceOffering need to be set.
*/
try {
} catch (Exception e) {
+ "Exception:", e);
}
return results;
}
/**
* Modify DiscoEntries for the default organization.
* @param userID This is not used in this implementation.
*
* @param removes List of
* com.sun.identity.liberty.ws.disco.jaxb.RemoveEntryType jaxb
* objects.
* @param inserts List of
* com.sun.identity.liberty.ws.disco.jaxb.InsertEntryType 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 entryIds for the entries that were added.
* "OK", and there are InsertEntry elements in the Modify request.
* When successful, all modification (removes and inserts) should
* be done. No partial changes should be done.
*/
{
+ "Entries: init ");
}
try {
// Try to register discovery service if not already registered
discoEntries, removes)) {
return result;
}
}
return result;
}
}
DYNAMIC_ATTR_NAME, entries)) {
return result;
} else {
}
return result;
}
} catch (DiscoveryException de) {
"DiscoEntries: Exception", de);
return result;
"DiscoEntries: Exception", ex);
return result;
}
}
}