/**
* 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: CircleOfTrustDescriptor.java,v 1.5 2008/06/25 05:46:38 qcheng Exp $
*
*/
/**
* The <code>COTDescriptor</code> class is the representation
* of the circle of trust configuration.
*/
public class CircleOfTrustDescriptor {
// map holding protocol to set of trusted providers
/*
* Private Constructor.
* This constructor populates object from the attribute
* Map received from the data store.
*
* @param name The name of circle of trust.
* @param realm The realm the circle of trust resides.
* @param attrMap The map which contains attributes of the circle
* of trust.
* @throws COTException if values in the map are invalid.
*/
throws COTException {
}
/**
* Creates new <code>COTDescriptor</code> instance.
*
* @param circleOfTrustName name for the circleOfTrust
* @param realm The realm the circle of trust resides.
* @param circleOfTrustStatus status of the CircleOfTrust.
* @throws COTException if <code>circleOfTrustName</code>
* or <code>circleOfTrustStatus</code> is invalid.
*/
}
/**
* Creates new <code>COTDescriptor</code> instance.
*
* @param circleOfTrustName name for the circleOfTrust
* @param realm The realm this circle of trust resides.
* @param circleOfTrustStatus status of the CircleOfTrust.
* @param circleOfTrustDescription description for the circleOfTrust.
* @param circleOfTrustIDFFReaderURL the reader url of the CircleOfTrust.
* @param circleOfTrustIDFFWriterURL the writer url of the circleOfTrust.
* @param circleOfTrustSAML2ReaderURL the reader url of the CircleOfTrust.
* @param circleOfTrustSAML2WriterURL the writer url of the circleOfTrust.
* @param circleOfTrustProvider the trusted providers of the CircleOfTrust.
* @throws COTException if any input parameter is invalid.
*/
throws COTException {
if (circleOfTrustIDFFReaderURL != null) {
}
if (circleOfTrustIDFFWriterURL != null) {
}
if (circleOfTrustSAML2ReaderURL != null) {
}
if (circleOfTrustSAML2WriterURL != null) {
}
}
/**
* Validates and set the circle of trust name.
*/
}
}
/**
* Validates and set the circle of trust type.
*/
}
}
/**
* Returns name of the Circle of Trust.
*
* @return name of the Circle of Trust.
*/
return circleOfTrustName;
}
/**
* Returns name of the realm the Circle of Trust resides.
*
* @return realm name.
*/
return realm;
}
/**
* Returns status of the Circle of Trust.
*
* @return status of the Circle of Trust. It can be
* "active" or "inactive"
*/
return circleOfTrustStatus;
}
/**
* Returns description of the Circle of Trust.
*
* @return description of the Circle of Trust.
*/
return circleOfTrustDescription;
}
/**
* Returns reader service URL of the Circle of Trust for ID-FF protocol.
*
* @return Reader service URL for ID-FF protocol.
*/
if (idffReaderServiceURL != null) {
return idffReaderServiceURL;
} else if ((circleOfTrustType != null) &&
// handle legacy case
return readerServiceURL;
} else {
return null;
}
}
/**
* Returns reader service URL of the Circle of Trust for SAMLv2 protocol.
*
* @return Reader service URL for SAMLv2 protocol.
*/
if (saml2ReaderServiceURL != null) {
return saml2ReaderServiceURL;
} else if ((circleOfTrustType != null) &&
// handle legacy case
return readerServiceURL;
} else {
return null;
}
}
/**
* Returns Writer Service URL of the Circle of Trust for ID-FF protocol.
*
* @return the Writer service URL for ID-FF protocol.
*/
if (idffWriterServiceURL != null) {
return idffWriterServiceURL;
} else if ((circleOfTrustType != null) &&
// handle legacy case
return writerServiceURL;
} else {
return null;
}
}
/**
* Returns Writer Service URL of the Circle of Trust for SAMLv2 protocol.
*
* @return the Writer service URL for SAMLv2 protocol.
*/
if (saml2WriterServiceURL != null) {
return saml2WriterServiceURL;
} else if ((circleOfTrustType != null) &&
// handle legacy case
return writerServiceURL;
} else {
return null;
}
}
/**
* Sets description of the Circle of Trust.
*
* @param circleOfTrustDescription Description of the Circle of Trust.
*/
}
/**
* Sets reader service URL.
*
* @param readerServiceURL reader service URL.
* @throws COTException if <code>readerServiceURL</code>
* is not an URL.
*/
throws COTException {
if ((readerServiceURL != null) &&
try {
} catch (ValidationException e) {
}
}
this.readerServiceURL = readerServiceURL;
}
/**
* Sets reader service URL for ID-FF protocol.
*
* @param readerServiceURL reader service URL for ID-FF protocol.
* @throws COTException if <code>readerServiceURL</code>
* is not an URL.
*/
throws COTException {
if ((readerServiceURL != null) &&
try {
} catch (ValidationException e) {
}
}
this.idffReaderServiceURL = readerServiceURL;
}
/**
* Sets reader service URL for SMALv2 protocol.
*
* @param readerServiceURL reader service URL of SAMLv2 protocol.
* @throws COTException if <code>readerServiceURL</code>
* is not an URL.
*/
throws COTException {
if ((readerServiceURL != null) &&
try {
} catch (ValidationException e) {
}
}
}
/**
* Sets writer service URL.
*
* @param writerServiceURL writer service URL of the Circle of Trust.
* @throws COTException if <code>writerServiceURL</code>
* is not an URL.
*/
throws COTException {
if ((writerServiceURL != null) &&
){
try {
} catch (ValidationException e) {
}
}
this.writerServiceURL = writerServiceURL;
}
/**
* Sets writer service URL for IDFF protocol.
*
* @param writerServiceURL writer service URL of the Circle of Trust.
* @throws COTException if <code>writerServiceURL</code>
* is not an URL.
*/
throws COTException {
if ((writerServiceURL != null) &&
){
try {
} catch (ValidationException e) {
}
}
this.idffWriterServiceURL = writerServiceURL;
}
/**
* Sets writer service URL for SAML2 protocol.
*
* @param writerServiceURL writer service URL of the Circle of Trust.
* @throws COTException if <code>writerServiceURL</code>
* is not an URL.
*/
throws COTException {
if ((writerServiceURL != null) &&
){
try {
} catch (ValidationException e) {
}
}
}
/**
* Sets status of a circle of trust.
*
* @param circleOfTrustStatus the circle of trust status. The valid value
* for status is "active" or "inactive".
* @throws COTException if <code>circleOfTrustStatus</code>
* is blank or it is not "active" or "inactive"
*/
throws COTException {
if (circleOfTrustStatus !=null &&
} else {
}
}
/**
* Sets trusted providers of a circle of trust.
*
* @param circleOfTrustProvider A set of trusted providers
*/
}
/**
* Returns a set of trusted providers in the circle of trust.
*
* @return a set of trusted providers in the circle of trust, or null
* if there is no trusted providers in the circle of trust.
*/
if (trustedProviders == null) {
return null;
} else {
return ret;
}
}
/**
* Returns a set of trusted providers in the circle of trust for a specific
* protocol.
* @param protocol name of the federation protocol
* @return a set of trusted providers in the circle of trust, or null if
* such entity does not exist.
*/
return null;
} else {
// handle legacy case
if ((circleOfTrustType == null)
return ret;
} else {
return null;
}
} else {
return null;
}
}
}
/**
* Adds entity identifier to trusted providers set within the
* circle of trust.
*
* @param entityID the entity id of a provider .
* @param protocol name of protocol for the entity.
* @return true if the set did not already contain the entityID.
*/
}
if ((trustedProviderMap == null)
if (trustedProviders != null) {
}
+ protocol);
return result;
} else {
}
}
/**
* Removes member from the trusted provider set within this circle
* of trust.
*
* @param entityID The entity id of a provider.
* @param protocol name of protocol for the entity.
* @return true if the set contained the entityID.
*/
return false;
}
if ((trustedProviderMap == null) ||
return false;
}
if (trustedProviders != null) {
}
+ protocol);
if (!result) {
// handle legacy case
}
return result;
}
/**
* Returns attributes of this object into a map.
*/
return attrMap;
}
}