/**
* 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: IdRepoSampleUtils.java,v 1.5 2008/08/07 22:08:20 goodearth Exp $
*
*/
/**
* This class
*
*
* @author
*/
public class IdRepoSampleUtils {
public IdRepoSampleUtils() {
}
{
try {
} catch (AuthLoginException le) {
"IdRepoSampleUtils: could not get AuthContext for realm " +
realm);
throw le;
}
try {
} catch (AuthLoginException le) {
"for default authmodule");
throw le;
}
while (lc.hasMoreRequirements()) {
try {
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
userid);
return null;
}
try {
} catch (Exception e) {
throw e;
}
return ssoToken;
}
try {
} catch (AuthLoginException alexc) {
userID + "'");
throw alexc;
}
}
throws Exception
{
if (callbacks[i] instanceof NameCallback) {
} else if (callbacks[i] instanceof PasswordCallback) {
} else if (callbacks[i] instanceof TextInputCallback) {
} else if (callbacks[i] instanceof ChoiceCallback) {
}
}
}
int c;
try {
char ch = (char)c;
if (ch == '\r') {
continue;
}
if (ch == '\n') {
break;
}
}
} catch (IOException e) {
}
}
return (getLine());
}
tmp = defaultVal;
}
return (tmp);
}
/*
* return integer value of String sVal; -1 if error
*/
int i = -1;
try {
} catch (NumberFormatException e) {
"' does not appear to be an integer.");
}
return i;
}
/*
* can only create or delete AMIdentities of IdType user, agentgroup,
* agentonly
*/
{
"\t0: user\n\t1: agent\n\t2: agentonly\n\t3: agentgroup\n\t4: realm\n\t5: No selection");
int i = getIntValue(answer);
switch (i) {
case 0: // user
break;
case 1: // agent
break;
case 2: // agentonly
break;
case 3: // agentgroup
break;
case 4: // realm
break;
case 5: // no selection
break;
default: // invalid selection
}
return tType;
}
/*
* get the IdType selected from the list of supported IdTypes for
* this AMIdentityRepository object. can be "null" if no selection
* made.
*/
try {
int i = 0;
}
i = getIntValue(answer);
return (null);
} else {
return (null);
}
} catch (IdRepoException ire) {
ire.getMessage());
} catch (SSOException ssoe) {
ssoe.getMessage());
}
return (tType);
}
/*
* print out elements in the Set "results". header and trailer
* titling Strings. more generic (i.e., usually expecting Strings)
* than other printResults(String, Set).
*/
public void printResults (
{
} else {
trailer + ":");
}
}
return;
}
/*
* print out elements in the Set "results". header and trailer
* titling Strings. more generic (i.e., usually expecting Strings)
* than other printResults(String, Set).
*/
public void printResultsRealm (
{
} else {
trailer + ":");
}
}
return;
}
/*
* for the Set of IdTypes specified in "results", get and print
* 1. the IdTypes it can be a member of
* 2. the IdTypes it can have as members
* 3. the IdTypes it can add to itself
*/
public void printIdTypeResults(
{
} else {
trailer + ":");
}
}
return;
}
/*
* used by printIdTypeResults(), above, to print out
* AMIdentity names of elements in the Set.
*/
private void printIdTypeSet (
{
}
} else {
}
}
/*
* print the objects (String or AMIdentity.getName()) in the
* specified Array, and return the index of the one selected.
* -1 if none selected.
*/
public int selectFromArray (
{
boolean isIdType = false;
boolean isString = false;
return (-1);
}
int i = -1;
isIdType = true;
isString = true;
}
if (isIdType) {
} else if (isString) {
} else {
}
}
i = getIntValue(ans);
return i;
}
/*
* print the objects (String or AMIdentity.getName()) in the
* specified Set, and return the object of the one selected.
* null if none selected.
*/
{
int i;
boolean isAMId = false;
boolean isString = false;
if (setsize <= 0) {
return null;
}
isAMId = true;
isString = true;
}
if (setsize > 0) {
for (i = 0; i < setsize; i++) {
if (isAMId) {
} else if (isString) {
} else {
}
}
} else {
"' is invalid.");
}
}
return null;
}
public void waitForReturn() {
waitForReturn("Hit <return> when ready: ");
}
}
}