ActionDecision.java revision 6636284dd99df27fda992fb77fb6236657269ec9
/**
* 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: ActionDecision.java,v 1.5 2008/06/25 05:43:43 qcheng Exp $
*
* Portions Copyrighted 2011-2014 ForgeRock AS.
*/
/**
* The <code>ActionDecision</code> class represents the action results of a
* policy evaluation. It has action values for a given <code>action</code> and
* <code>advice</code>.
*
* @supported.api
* @deprecated since 12.0.0
*/
public class ActionDecision {
private String actionName;
/**
* Difference of system clock on the client machine compared to
* policy server machine. Valid life of policy decisions are extended
* by this skew on the client side.
* Value for this is set by reading property
* com.sun.identity.policy.client.clockSkew
* from SystemProperties
* If the value is not defined in AMConfig.properties,
* this would default to 0.
*/
private static long clientClockSkew = 0;
/**
* No argument constructor
* @deprecated No replacement API provided.
* There should be no need to invoke this constructor.
*/
public ActionDecision() {
}
/**
* Constructor
* @param actionName name of the action.
* @param values a <code>Set></code> of <code>String</code> values for the
* action
* @supported.api
*/
this.actionName = actionName;
}
/**
* Constructor
* @param actionName action name
* @param values a <code>Set</code> of <code>String</code> values for the
* action
* @param advices <code>advices</code> associated with this action
* decision. The advice name is the key to the Map. The
* value is a set of advice message Strings corresponding
* to the advice name.
* @param timeToLive the GMT time in milliseconds since epoch
* when this object is to be treated as expired.
* That is the action values would likely be different
* after that time.
* @supported.api
*/
long timeToLive
) {
this.actionName = actionName;
this.timeToLive = timeToLive;
}
/**
* Gets the name of the action
*
* @return name of the action
* @supported.api
*/
public String getActionName() {
return actionName;
}
/**
* Sets the action values for the action.
*
* @param values a <code>Set</code> of String values
* @supported.api
*/
}
/**
* Gets the action values for the action.
*
* @return a <code>Set>/code> of String values
* @supported.api
*/
return values;
}
/**
* Gets the GMT time in milliseconds since epoch when this object is to
* be treated as expired. That is the action values would likely be
* different after that time.
* This is computed as a result of <code>SimpleTimeCondition(s)</code>
* specified in the Policy definition.
*
* @return long represeting the time to live for this object.
* @supported.api
*/
public long getTimeToLive() {
return timeToLive;
}
/**
* Sets the GMT time in milliseconds since epoch when this object is to
* be treated as expired. That is the action values would likely be
* different after that time.
* This is computed as a result of <code>SimpleTimeCondition(s)</code>
* specified in the Policy definition.
*
* @param timeToLive time to live
* @supported.api
*/
public void setTimeToLive(long timeToLive) {
this.timeToLive = timeToLive;
}
/**
* Sets <code>advices</code> associated with this <code>ActionDecision
* </code>.
* The advice name is the key to the <code>Map</code>. The
* value is a <code>Set</code> of advice message Strings corresponding to
* the advice name. The two possible advices are authentication
* level(<code>AuthLevel</code>) and authentication modules
* (<code>AuthSchemes</code>). The advice message Strings for
* <code>AuthLevel</code> are integer valued.
*
* @param advices map of advices
* @supported.api
*/
}
/**
* Returns a <code>Map</code> of <code>advices</code> associated with this
* object.
* The advice name is the key to the <code>Map</code>. The
* value is a <code>Set</code> of advice message Strings corresponding to
* the advice name. The two possible advices are authentication
* level(<code>AuthLevel</code>) and authentication modules
* (<code>AuthSchemes</code>). The advice message Strings for
* <code>AuthLevel</code> are integer valued.
*
* @return advices associated with this <code>ActionDecision</code>.
* @supported.api
*/
public Map getAdvices() {
return advices;
}
/**
* Gets a String representation of this object
*
* @return a String representation of this object
* @supported.api
*/
}
/**
* Gets an XML representation of this object
*
* @return XML representation of this object
* @supported.api
*/
values));
}
}
/**
* Creates an ActionDecisions object given a w3c DOM node
* @param actionDecisionNode w3c DOM node for action decision
*
* @return ActionDecisions object created using the w3c DOM node
* @throws PolicyException if any error occurs during parsing.
*/
throws PolicyException {
//process action name and values
return null;
}
//process timeToLive
try {
}
} catch (Exception e) {
+ " ActionDecision:" + ttlString);
"invalid_time_to_live",
args,e);
}
}
//process advices
if ( adviceName != null ) {
}
}
}
}
return actionDecision;
}
/**
* Creates and returns a copy of this object.
*
* @return a copy of this object
*/
while (valuesIter.hasNext()) {
}
}
while (adviceIter.hasNext()) {
}
}
return clone;
}
/**
* Sets the client clock skew
* @param skew the time skew in milliseconds, serverTime - clientTime
*/
public static void setClientClockSkew(long skew) {
}
}