1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest/*
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest * The contents of this file are subject to the terms of the Common Development and
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest * Distribution License (the License). You may not use this file except in compliance with the
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest * License.
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest *
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest * specific language governing permission and limitations under the License.
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest *
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest * When distributing Covered Software, include this CDDL Header Notice in each file and include
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest * Header, with the fields enclosed by brackets [] replaced by your own identifying
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest * information: "Portions copyright [year] [name of copyright owner]".
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest *
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest * Copyright 2013 ForgeRock Inc.
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest */
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrestpackage com.sun.identity.sm;
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrestimport com.iplanet.sso.SSOToken;
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrestimport java.util.Iterator;
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrestimport java.util.Set;
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest/**
bf41c4342792552d38ff8e8857d4869470694fe3Andrew Forrest * Until SMSEntry is refactored to separate out its various responsibilities, for now this wrapper class delegates to it.
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest * This allows consumers to not be coupled to a concrete implementation and to static method calls.
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest *
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest * @author apforrest
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest */
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrestpublic class ServiceManagementDAOWrapper implements ServiceManagementDAO {
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest @Override
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest public Iterator<SMSDataEntry> search(SSOToken token, String dn, String filter,
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest int numOfEntries, int timeLimit, boolean sortResults,
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest boolean ascendingOrder, Set<String> exclude) throws SMSException {
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest // This assignment is valid.
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest // The warning is flagged up due to integration with legacy code.
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest @SuppressWarnings("unchecked")
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest Iterator<SMSDataEntry> results = SMSEntry.search(
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest token, dn, filter, numOfEntries, timeLimit, sortResults, ascendingOrder, exclude);
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest return results;
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest }
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest @Override
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest public boolean checkIfEntryExists(String dn, SSOToken token) {
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest return SMSEntry.checkIfEntryExists(dn, token);
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest }
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest
bf41c4342792552d38ff8e8857d4869470694fe3Andrew Forrest @Override
bf41c4342792552d38ff8e8857d4869470694fe3Andrew Forrest public String getRootSuffix() {
bf41c4342792552d38ff8e8857d4869470694fe3Andrew Forrest return SMSEntry.getRootSuffix();
bf41c4342792552d38ff8e8857d4869470694fe3Andrew Forrest }
bf41c4342792552d38ff8e8857d4869470694fe3Andrew Forrest
1351c9607d0f3eb5f61b8c90cf53b997dc7744b7Andrew Forrest}