DirectoryManagerImpl.java revision 8af80418ba1ec431c8027fa9668e5678658d3611
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 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: DirectoryManagerImpl.java,v 1.20 2009/07/02 20:26:16 hengming Exp $
*
*/
/**
* Portions Copyrighted [2011] [ForgeRock AS]
*/
public class DirectoryManagerImpl extends IdRepoJAXRPCObjectImpl implements
protected static SSOTokenManager tm;
protected static boolean initialized;
// Handle to all the new DirectoryServices implementations.
protected static IDirectoryServices dsServices;
protected static IDCTreeServices dcTreeServices;
protected static IComplianceServices complianceServices;
// Cache of modifications for last 30 minutes & notification URLs
public DirectoryManagerImpl() {
// Empty constructor
}
private static void initialize_cache() {
if (debug.messageEnabled()) {
debug.message("DirectoryManagerImpl::initialize_cache EventNotification cache size is set to " + cacheSize);
}
}
}
protected void initialize() throws RemoteException {
if (initialized) {
return;
}
// Get TokenManager and register this class for events
try {
initialized = true;
if (debug.messageEnabled()) {
+ serverURL);
}
} catch (Exception e) {
}
}
initialize();
try {
} catch (AMException e) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + e);
}
throw convertException(e);
}
}
initialize();
try {
} catch (AMException e) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + e);
}
throw convertException(e);
}
}
initialize();
}
initialize();
try {
serviceName, type);
} catch (AMException e) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + e);
}
throw convertException(e);
}
}
initialize();
try {
} catch (AMException e) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + e);
}
throw convertException(e);
}
}
initialize();
try {
} catch (AMException e) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + e);
}
throw convertException(e);
}
}
public Map getAttributes2(
int profileType
initialize();
try {
} catch (AMException e) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + e);
}
throw convertException(e);
}
}
public Map getAttributesByteValues1(
int profileType
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
public Map getAttributesByteValues2(
int profileType
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
throws RemoteException {
initialize();
}
throws RemoteException {
initialize();
}
public Map getDCTreeAttributes(
boolean byteValues,
int objectType
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
public Map getExternalAttributes(
int profileType
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
public LinkedList getGroupFilterAndScope(
int profileType
initialize();
try {
return list;
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
throws RemoteException {
initialize();
}
initialize();
}
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
public String verifyAndGetOrgDN(
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
throws RemoteException {
initialize();
}
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
public String getSearchFilterFromTemplate(
int objectType,
) throws RemoteException {
initialize();
}
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
public boolean isAncestorOrgDeleted(
int profileType
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
public void modifyMemberShip(
int type,
int operation
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
public void registerService(
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
public void removeEntry(
int objectType,
boolean recursive,
boolean softDelete
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
public String renameEntry(
int objectType,
boolean deleteOldName
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
int searchScope
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
// Construct the SortKeys
initialize();
int keysLength = 0;
for (int i = 0; i < keysLength; i++) {
}
}
// Construct SearchControl
}
} else {
}
// Perform the search
try {
// Convert results to Map
}
return (answer);
} catch (AMException amex) {
if (debug.messageEnabled()) {
}
throw convertException(amex);
}
}
// Construct the SortKeys
initialize();
int keysLength = 0;
for (int i = 0; i < keysLength; i++) {
}
}
// Construct SearchControl
}
} else {
}
// Perform the search
try {
// Convert results to Map
}
return (answer);
} catch (AMException amex) {
if (debug.messageEnabled()) {
}
throw convertException(amex);
}
}
public void setAttributes(
int objectType,
boolean isAdd
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
public void unRegisterService(
int objectType,
int type
initialize();
try {
// TODO FIX LATER
serviceName, type);
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
public void updateUserAttribute(
boolean toAdd
initialize();
try {
toAdd);
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
.getMessageArgs()));
} else {
}
}
for (int i = 0; i < count; i++) {
}
return strArray;
}
return null;
}
public Map getAttributes4(
boolean ignoreCompliance,
boolean byteValues,
int profileType
initialize();
try {
} catch (AMException amex) {
if (debug.messageEnabled()) {
+ " Caught Exception: " + amex);
}
throw convertException(amex);
}
}
// Notification methods
// Since clients tend to request for objects changed
// donot initialize which might thrown an excpetion
// initialize();
// Get the cache index for times upto time+2
cacheIndex--;
}
if (debug.messageEnabled()) {
}
return (answer);
}
throws RemoteException {
// Since clients tend to register for AMSDK and IdRepo
// donot initialize which might thrown an excpetion
// initialize();
try {
// Check URL is not the local server
if (!isClientOnSameServer(url)) {
synchronized (notificationURLs) {
}
if (debug.messageEnabled()) {
+ "registerNotificationURL register for "
+ "notification URL: " + url);
}
} else {
// Cannot add this server for notifications
if (debug.warningEnabled()) {
+ "cannot add local server: " + url);
}
throw (new RemoteException("invalid-notification-URL"));
}
} catch (MalformedURLException e) {
if (debug.warningEnabled()) {
+ " invalid URL: " + url, e);
}
}
return (id);
}
throws RemoteException {
// Since clients tend to register & deregister for AMSDK and IdRepo
// donot initialize which might thrown an excpetion
// initialize();
synchronized (notificationURLs) {
}
}
// Implementation to process entry changed events
+ "processing");
// Obtain the cache index
// Maintain cacheIndex
}
// Construct the XML document for the event change
"</Value></AttributeValuePair>").append(
"<AttributeValuePair><Attribute name=\"entityName\" />")
"</Value></AttributeValuePair>");
"</Value></AttributeValuePair>");
"name=\"attrNames\"/>");
}
}
}
// Add to cache
if (debug.messageEnabled()) {
+ notificationURLs.values());
}
// If notification URLs are present, send notifications
synchronized (notificationURLs) {
// Construct NotificationSet
ns = new NotificationSet(
.SDK_SERVICE);
}
try {
if (debug.messageEnabled()) {
}
} catch (SendNotificationException ne) {
if (debug.warningEnabled()) {
+ "URL from notification list.", ne);
}
// Remove the URL from Notification List
}
}
}
}
// Implementation for AMObjectListener
}
}
}
public void allObjectsChanged() {
}
// Do nothing
}
public Map getConfigMap() {
return (null);
}
}