AgentProvider.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 copyght owner]"
*
* $Id: AgentProvider.java,v 1.41 2009/11/16 21:52:58 mallas Exp $
*
*/
/**
* This class <code>AgentProvider</code> extends from
* <code>ProviderConfig</code> to manage the web services
* server provider or the web services client configuration via Access
* Manager Agents.
*/
public class AgentProvider extends ProviderConfig {
// Initialize the Attributes names set
private static final String AGENT_DEVICE_STATUS_ATTR =
"sunIdentityServerDeviceStatus";
private static final String REQUEST_HEADER_ENCRYPT =
"isRequestHeaderEncrypt";
private static final String SAML_ATTRIBUTE_MAPPING =
"SAMLAttributeMapping";
private static final String KRB_SERVICE_PRINCIPAL =
"KerberosServicePrincipal";
private static final String KRB_TICKET_CACHE_DIR =
"KerberosTicketCacheDir";
private static final String USE_PASSTHROUGH_TOKEN =
"isPassThroughSecurityToken";
private static final String USER_TOKEN_DETECT_REPLAY =
"DetectUserTokenReplay";
private static final String MESSAGE_REPLAY_DETECTION =
"DetectMessageReplay";
private AMIdentityRepository idRepo;
private static Set agentConfigAttribute;
// Instance variables
private boolean profilePresent;
static {
}
throws ProviderException {
this.providerName = providerName;
this.providerType = providerType;
if(debug.messageEnabled()) {
"type = " + providerType);
}
// Obtain the WSP Agent profile given its end point
try {
}
control.setAllReturnAttributes(true);
"*", control);
//Map attrs = (Map) results.getResultAttributes();
} else {
}
if (debug.messageEnabled()) {
+ "Provider Configuration using end point : "
+ attributes);
}
profilePresent = true;
}
throw (new ProviderException("idRepo exception: "
+ ex.getMessage()));
}
return;
}
// Obtain the provider from Agent profile based on ProviderName
try {
if(debug.messageEnabled()) {
+ "does not exist");
}
return;
}
profilePresent = true;
if (debug.messageEnabled()) {
+ "Provider configuration: "
+ attributes);
}
} catch (IdRepoException ire) {
//permission denied
profilePresent = false;
return;
}
throw (new ProviderException("idRepo exception: "
+ ire.getMessage()));
} catch (Exception e) {
}
}
return;
}
}
}
}
}
}
return;
}
while(st.hasMoreTokens()) {
}
this.wspEndpoint = value;
this.wssProxyEndpoint = value;
this.isRequestHeaderEncrypted =
this.privateKeyAlias = value;
this.publicKeyAlias = value;
this.privateKeyType = value;
this.serviceType = value;
try {
} catch (ProviderException pe) {
"error",pe);
}
}
try {
} catch (ProviderException pe) {
"error",pe);
}
}
if(usercredentials == null) {
usercredentials = new ArrayList();
}
while(stVal.hasMoreTokens()) {
if(index == -1) {
return;
}
if(st.hasMoreTokens()) {
}
}
if(st1.hasMoreTokens()) {
}
}
}
}
}
}
this.authenticationChain = value;
}
if(samlAttributes == null) {
samlAttributes = new HashSet();
}
return;
}
while(st.hasMoreTokens()) {
}
}
this.attributeNS = value;
this.nameIDMapper = value;
this.servicePrincipal = value;
this.keytabFile = value;
this.ticketCacheDir = value;
}
this.usePassThroughToken =
}
this.tokenConversionType = value;
this.signingRefType = value;
}
this.encryptionAlgorithm = value;
}
}
this.detectUserTokenReplay =
}
this.detectMessageReplay =
}
}
if (signedElements == null) {
signedElements = new ArrayList();
}
return;
}
while(st.hasMoreTokens()) {
}
} else {
"Attribute configured." + attr);
}
}
}
public void store() throws ProviderException {
if(wspEndpoint != null) {
}
if(wssProxyEndpoint != null) {
}
}
}
}
if(serviceType != null) {
}
}
}
}
if(authenticationChain != null) {
}
if(privateKeyAlias != null) {
}
if(privateKeyType != null) {
}
if(publicKeyAlias != null) {
}
while(props.hasMoreElements()) {
}
if(usercredentials != null) {
continue;
}
}
}
}
}
}
}
}
if(attributeNS != null) {
}
if(nameIDMapper != null) {
}
if(includeMemberships) {
}
if(verifyKrbSignature) {
}
}
}
if(servicePrincipal != null) {
}
if(ticketCacheDir != null) {
}
if(keytabFile != null) {
}
if(usePassThroughToken) {
}
if(tokenConversionType != null) {
}
if(signingRefType != null) {
}
if(encryptionAlgorithm != null) {
}
}
}
if(signedElements != null) {
}
}
// Save the entry in Agent's profile
try {
}
}
}
}
if (profilePresent) {
// Construct AMIdentity object and save
if (debug.messageEnabled()) {
}
} else {
// Create a new Agent profile
}
if (debug.messageEnabled()) {
+ attributes);
}
}
} catch (Exception e) {
}
}
public void delete() throws ProviderException {
if (!profilePresent) {
return;
}
// Delete the agent profile
try {
}
// Construct AMIdentity object to delete
} catch (Exception e) {
}
}
}
/**
* Checks if the agent profile exists for this provider.
* @return true if the profile exists.
*/
public boolean isExists() {
return profilePresent;
}
}