/**
* 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: PolicyListenerRequest.java,v 1.3 2008/06/25 05:43:53 qcheng Exp $
*
*/
/*
* Portions Copyrighted [2011] [ForgeRock AS]
*/
/**
* This <code>PolicyListenerRequest</code> class represents an
* AddPolicyListener XML document. The AddPolicyListener DTD is
* defined as the following:
* <p>
* <pre>
* <!-- AddPolicyListener element adds a policy listener to the
* service to receive the policy notification.
* The attribute serviceName specifies the service name.
* The attribute notificationURL provides the notification
* URL for the policy server to send the notification to.
* -->
*
* <!ELEMENT AddPolicyListener EMPTY >
* <!ATTLIST AddPolicyListener
* serviceName NMTOKEN #REQUIRED
* notificationURL CDATA #REQUIRED
* >
* </pre>
* <p>
*/
/**
* Default constructor for <code>PolicyListenerRequest</code>
*/
public PolicyListenerRequest() {
}
/**
* Returns the service name on which this listener listens.
*
* @return service name.
*/
return serviceName;
}
/**
* Sets the service name on which this listener listens
*
* @param name Service name.
*/
serviceName = name;
}
/**
* Returns the notification URL to which the notification is sent.
*
* @return notification URL
*/
return notificationURL;
}
/**
* Sets the notification URL to which the notification is sent.
*
* @param url the notification URL.
*/
}
/**
* Returns <code>PolicyListenerRequest</code> object constructed from
* a XML.
*
* @param pNode the XML DOM node for the <code>PolicyListenerRequest</code>
* object.
* @return constructed <code>PolicyListenerRequest</code> object.
*/
throws PolicyEvaluationException
{
new PolicyListenerRequest();
+ SERVICE_NAME);
}
+ NOTIFICATION_URL);
}
return policyListenerReq;
}
/**
* Returns a XML representation of this object.
*
* @return a XML representation of this object.
*/
{
}
/**
* Returns the service name on which the listener listens.
*
* @return service name.
*/
return serviceName;
}
/**
* Handles policy change event.
*
* @param evt the policy event regarding the policy change.
*/
"invalid policy event");
return;
}
// get the policy change type from the event
} else {
}
// get the resource names from the event
if (debug.messageEnabled()) {
"PolicyListenerRequest.policyChanged(PolicyEvent): " +
"resource names from the policy event : " +
}
/*
* sets the service name and resource names which are affected
* by this policy change notification.
*/
/*
* create a Notification object based on the policy change
* notification.
*/
// add the notification to the notification set to be sent to the client
if (debug.messageEnabled()) {
"PolicyListenerRequest.policyChanged(PolicyEvent): " +
}
try {
// sends the notification to the client
if (debug.messageEnabled()) {
"PolicyListenerRequest.policyChanged(PolicyEvent): " +
"the policy change notification has been sent to " +
}
} catch (SendNotificationException e) {
"PLLServer.send() failed", e);
} catch (MalformedURLException e) {
"PLLServer.send() failed", e);
}
}
}