/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2009 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: PrivilegeChangeNotifier.java,v 1.5 2010/01/07 00:19:11 veiming Exp $
*
* Portions Copyrighted 2014-2015 ForgeRock AS.
*/
public class PrivilegeChangeNotifier {
static {
"privilege-notifier-threadpool-size", 5);
"privilege-notifier-conn-timeout", 1000);
"privilege-notifier-retries", 3);
"privilege-notifier-duration-between-retries", 3000);
}
private static int getConfiguration(
int defaultVal
) {
return defaultVal;
}
try {
} catch (NumberFormatException e) {
"PrivilegeChangeNotifier.getConfiguration: attribute name=" +
name, e);
return defaultVal;
}
}
private PrivilegeChangeNotifier() {
}
return instance;
}
public void notify(
try {
for (EntitlementListener l : listeners) {
applicationName, resources)) {
}
}
}
} catch (JSONException e) {
} catch (EntitlementException e) {
}
}
private boolean toSendNotification(
return true;
}
return true;
}
}
}
}
return false;
}
private boolean doesResourceMatch(
return true;
}
}
return false;
}
}
Task(
) {
this.adminSubject = adminSubject;
}
public void run() {
int cnt = 0;
boolean done = false;
done = postRequest();
if (!done) {
try {
} catch (InterruptedException e) {
//ignore
}
}
}
if (!done) {
try {
} catch (EntitlementException ex) {
"PrivilegeChangeNotifier.Task.run", ex);
}
}
}
private boolean postRequest() {
try {
try {
conn.setDoOutput(true);
wr = new OutputStreamWriter(
conn.getOutputStream());
} catch (SocketTimeoutException e) {
"PrivilegeChangeNotifier.Task.postRequest", e);
return false;
} catch (IOException e) {
"PrivilegeChangeNotifier.Task.postRequest", e);
return false;
}
} finally {
try {
}
}
} catch (IOException e) {
//ignore
}
}
}
}
}