IdRepoSampleSearchIds.java revision b41c8f49ce3f7a1704fc476c272271b75fc55dab
/**
* 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: IdRepoSampleSearchIds.java,v 1.4 2008/06/25 05:41:14 qcheng Exp $
*
* Portions Copyrighted 2015 ForgeRock AS.
*/
/**
* This class
*
*
* @author
*/
public class IdRepoSampleSearchIds {
sampleUtils = new IdRepoSampleUtils();
}
public void searchAMIds () {
return;
}
isc.setAllReturnAttributes(true);
// recursive setting is done via the data store config
try {
control.setAllReturnAttributes(true);
"*", control);
} catch (IdRepoException ire) {
" Searching Identities for '" +
ire.getMessage());
} catch (SSOException ssoe) {
" Searching Identities for '" +
ssoe.getMessage());
}
return;
}
/*
* given a set of AMIdentities of IdType idtype, see
* if any AMIdentity operations are to be performed
*/
{
int i;
if (setsize > 0) {
for (i = 0; i < setsize; i++) {
}
setsize + "]: ");
try {
return;
} else {
"' is invalid.");
return;
}
/*
* have the AMIdentity to work with in amid
*
* for IdType given, the operations allowed:
*
* GROUP
*/
/*
* can:
* get attributes
* get attribute
* get members (of type User)
*/
"Members of IdType User of Group '" +
/*
* can:
* get attributes
* get attribute
* get members
*/
/*
* can:
* see if active
* set active status
* get attributes
* get attribute
* set attributes
* remove attributes
* store
* get memberships
* see if exists
*/
{
// don't want to mess too much with these users
// in particular
" can have (and has) membership in identities of " +
"the following types:");
idTypeToUse.getName());
}
} else {
"Set user active, inactive, or cancel [a,i,c]: ");
"' already active");
} else {
amid.setActiveStatus(true);
}
"' already inactive");
} else {
amid.setActiveStatus(false);
}
}
" can have (and has) membership in identities of " +
"the following types:");
idTypeToUse.getName());
}
"\tl: List groups or roles\n" +
"\td: Display attributes\n" +
"\ts: Set attribute\n" +
"\te: No selection");
"Enter selection [l, d, s, e]: ");
} else {
}
}
/*
* can:
* see if exists
* see if active
* set active status
* get attributes
* get attribute
* set attributes
* remove attributes
* store
*
*/
"Set agent active, inactive, or cancel [a,i,c]: ");
"' already active");
} else {
amid.setActiveStatus(true);
}
"' already inactive");
} else {
amid.setActiveStatus(false);
}
}
}
} catch (IdRepoException ire) {
ire.getMessage());
} catch (SSOException ssoe) {
ssoe.getMessage());
}
} else {
}
}
/*
* get and print the attributes for the AMIdentity specified.
*/
try {
}
} else {
}
}
} else {
}
} catch (IdRepoException ire) {
ire.getMessage());
} catch (SSOException ssoe) {
ssoe.getMessage());
}
}
/*
* print members of the specified IdType in the AMIdentity object
* specified.
*/
{
try {
"'s members:");
}
} else {
" has no members.");
}
} catch (IdRepoException ire) {
ire.getMessage());
} catch (SSOException ssoe) {
ssoe.getMessage());
}
}
/*
* print memberships of IdType specified in the Set provided.
*/
{
" has no memberships in identities of IdType " +
idTypeToUse.getName());
return;
}
" has membership in identities of IdType " +
}
} else {
" has no memberships in identities of IdType " +
idTypeToUse.getName());
}
}
/*
* get and print the attributes for the specified AMIdentity object.
* select the attribute to set, and value to which to set it, set it,
* then retrieve and print its value for verification.
*/
{
try {
name + "'s Attributes",
"Select attribute to set");
} else {
}
}
}
/*
* get attr value again to verify it changed
*/
} else {
}
}
}
}
} else {
}
} catch (IdRepoException ire) {
ire.getMessage());
} catch (SSOException ssoe) {
ssoe.getMessage());
}
}
/*
* list groups or roles for the specified user
*/
{
"Groups, or Roles to list [g, r]: ");
try {
trlr = "group memberships";
trlr = "role memberships";
}
} catch (IdRepoException ire) {
ire.getMessage());
} catch (SSOException ssoe) {
ssoe.getMessage());
}
}
}