EntityModelImpl.java revision 4a2f0f0be43dfd4c1b490cbf3cc48b6ba6084b1c
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 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: EntityModelImpl.java,v 1.20 2009/12/25 09:13:22 babysunil Exp $
*
*/
try {
} catch (AMConsoleException a) {
}
}
/**
* Returns a map with all entities including data about
* what realm, the roles, and location of each entity.
*
* @throws AMConsoleException if unable to retrieve the entities.
*/
public Map getEntities()
throws AMConsoleException
{
return allEntities;
}
/**
* Returns a map of all the samlv2 entities including data about
* what realm, the roles, and location of each entity.
*
* @throws AMConsoleException if unable to retrieve the Samlv2 entities.
*/
public Map getSAMLv2Entities()
throws AMConsoleException
{
try {
// get the roles this entity is acting in
} else if ((hostedEntities != null) &&
{
} else {
}
}
}
} catch (SAML2MetaException e) {
throw new AMConsoleException(e.getMessage());
}
}
/**
* Returns a map of all the idff entities including data about
* what realm, the roles, and location of each entity.
*
* @throws AMConsoleException if unable to retrieve the IDFF entities.
*/
public Map getIDFFEntities()
throws AMConsoleException
{
try {
} else if ((hostedEntities != null) &&
} else {
}
}
}
} catch (IDFFMetaException e) {
throw new AMConsoleException(e.getMessage());
}
}
/**
* Returns a map of all the wsfed entities including data about
* what realm, the roles, and location of each entity.
*
* @throws AMConsoleException if unable to retrieve the WSFED entities.
*/
public Map getWSFedEntities()
throws AMConsoleException
{
try {
new WSFederationMetaManager();
} else {
}
}
} catch (WSFederationMetaException e) {
throw new AMConsoleException(e.getMessage());
}
}
}
/**
* This is a convenience routine that can be used
* to convert a List of String objects to a single String in the format of
* "one; two; three"
*/
}
}
}
/**
* Creates an entity.
*
* @param data which contains the attributes of the entity to be created.
* @throws AMConsoleException if unable to create entity.
*/
}
}
/*
* TBD what is the best approach for creating a new provider with
* minimal input from the user
*
*/
throw new AMConsoleException("create SAML not implemented yet");
}
throw new AMConsoleException("create WSFed not implemented yet");
}
throw new AMConsoleException("create IDFF not implemented yet");
}
/**
* Deletes the entity specified.
*
* @param name Name of entity descriptor.
* @param protocol Protocol to which entity belongs.
* @param realm the realm in which the entity resides.
*
* @throws AMConsoleException if unable to delete entitiy.
*/
public void deleteEntities(
) throws AMConsoleException {
} else {
}
}
throws AMConsoleException
{
try {
} catch (SAML2MetaException e) {
throw new AMConsoleException("delete.entity.exists.error");
}
}
throws AMConsoleException
{
try {
} catch (IDFFMetaException e) {
throw new AMConsoleException(e.getMessage());
}
}
throws AMConsoleException
{
try {
(new WSFederationMetaManager()).deleteFederation(
} catch (WSFederationMetaException w) {
throw new AMConsoleException(w.getMessage());
}
}
/*
* This is used to determine what 'roles' a particular entity is
* acting as. It will producs a list of role names which can then
* be used by the calling routine for whatever purpose it needs.
*/
try {
// find out what role this dude is playing
}
}
}
} catch (IDFFMetaException s) {
if (debug.warningEnabled()) {
"Couldn't get SAMLMetaManager");
}
}
return roles;
}
boolean isSP = true;
int cnt = 0;
try {
new WSFederationMetaManager();
}
}
//to handle dual roles specifically for WSFED
{
if (o instanceof UriNamedClaimTypesOfferedElement) {
isSP = false;
} else if (o instanceof TokenIssuerEndpointElement) {
cnt++;
}
}
}
}
}
} catch (WSFederationMetaException e) {
}
}
/*
* This is used to determine what 'roles' a particular entity is
* acting as. It will producs a list of role names which can then
* be used by the calling routine for whatever purpose it needs.
*/
try {
if (d != null) {
// find out what role this dude is playing
}
}
}
}
if (SAML2MetaUtils.
getAttributeAuthorityDescriptor(d) != null) {
}
}
}
}
}
} catch (SAML2MetaException s) {
if (debug.warningEnabled()) {
"Couldn't get SAMLMetaManager");
}
}
}
return tab;
}
/*
* Creates a list of tab entries dynamically based on the roles supported
* for an entity.
*
*@param protocol the protocl which the entity belongs to.
*@param entity Name of entity descriptor.
*@param realm the realm in which the entity resides.
*/
// do not localize General. Its the name of a class file.
}
} else {
}
// create a tab for each role type
}
return entries;
}
/**
* Returns true if entity descriptor is an affiliate.
*
* @param protocol the Protocol to which entity belongs.
* @param realm the realm in which the entity resides.
* @param name Name of entity descriptor.
* @return true if entity descriptor is an affiliate.
*/
throws AMConsoleException {
boolean isAffiliate = false;
try {
idff_ad = (
samlv2_sd = (
}
isAffiliate = true;
}
} catch (IDFFMetaException e) {
if (debug.warningEnabled()) {
}
throw new AMConsoleException(getErrorString(e));
} catch (SAML2MetaException s) {
if (debug.warningEnabled()) {
"Couldn't get SAMLMetaManager");
}
throw new AMConsoleException(getErrorString(s));
}
return isAffiliate;
}
protected Set returnEmptySetIfValueIsNull(boolean b) {
return set;
}
}
return set;
}
}
for (int i=0;i<size;i++){
}
return set;
}
}
return list;
}
}
OrderedSet s = new OrderedSet();
}
return s;
}
}
return list;
}
}
return tmpMap;
}
}