Search in sources :

Example 6 with JsonIgnore

use of com.fasterxml.jackson.annotation.JsonIgnore in project OpenAM by OpenRock.

the class PolicyCondition method getPolicyCondition.

/**
     * Constructs a legacy policy {@link Condition} object based on the information contained in this adapter.
     *
     * @return the legacy policy condition.
     * @throws EntitlementException if an error occurs constructing the condition.
     */
@JsonIgnore
public Condition getPolicyCondition() throws EntitlementException {
    try {
        Condition cond = Class.forName(className).asSubclass(Condition.class).newInstance();
        cond.setProperties(properties);
        return cond;
    } catch (ClassNotFoundException cnfe) {
        throw new EntitlementException(UNKNOWN_POLICY_CLASS, new String[] { className }, cnfe);
    } catch (ClassCastException cce) {
        throw new EntitlementException(POLICY_CLASS_CAST_EXCEPTION, new String[] { className, Condition.class.getName() }, cce);
    } catch (InstantiationException ie) {
        throw new EntitlementException(POLICY_CLASS_NOT_INSTANTIABLE, new String[] { className }, ie);
    } catch (IllegalAccessException iae) {
        throw new EntitlementException(POLICY_CLASS_NOT_ACCESSIBLE, new String[] { className }, iae);
    } catch (PolicyException pe) {
        throw new EntitlementException(INVALID_PROPERTY_VALUE_UNKNOWN_VALUE, new String[] { className }, pe);
    }
}
Also used : Condition(com.sun.identity.policy.interfaces.Condition) EntitlementException(com.sun.identity.entitlement.EntitlementException) PolicyException(com.sun.identity.policy.PolicyException) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 7 with JsonIgnore

use of com.fasterxml.jackson.annotation.JsonIgnore in project OpenAM by OpenRock.

the class PolicyResponseProvider method getResponseProvider.

/**
     * Constructs a legacy response provider based on the information in this adapter.
     *
     * @return the legacy response provider
     * @throws EntitlementException if an error occurs constructing the response provider.
     */
@JsonIgnore
public ResponseProvider getResponseProvider() throws EntitlementException {
    try {
        ResponseProvider rp = Class.forName(className).asSubclass(ResponseProvider.class).newInstance();
        Map<String, Set<String>> properties = new HashMap<String, Set<String>>();
        properties.put(propertyName, propertyValues);
        rp.setProperties(properties);
        return rp;
    } catch (Exception ex) {
        throw new EntitlementException(510, ex);
    }
}
Also used : EntitlementException(com.sun.identity.entitlement.EntitlementException) Set(java.util.Set) HashSet(java.util.HashSet) HashMap(java.util.HashMap) ResponseProvider(com.sun.identity.policy.interfaces.ResponseProvider) JSONException(org.json.JSONException) EntitlementException(com.sun.identity.entitlement.EntitlementException) SSOException(com.iplanet.sso.SSOException) PolicyException(com.sun.identity.policy.PolicyException) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 8 with JsonIgnore

use of com.fasterxml.jackson.annotation.JsonIgnore in project XRTB by benmfaul.

the class WinObject method getJson.

/**
	 * The worker method for converting a WIN http target into a win
	 * notification in the bidder.
	 * 
	 * @param target
	 *            String. The HTTP url that makes up the win notification from
	 *            the exchange.
	 * @return String. The ADM field to be used by exchange serving up the data.
	 * @throws Exception
	 *             on REDIS errors.
	 */
@JsonIgnore
public static String getJson(String target) throws Exception {
    String image = null;
    String[] parts = target.split("http");
    String forward = "http:" + parts[1];
    if (parts.length > 2)
        image = "http:" + parts[2];
    parts = parts[1].split("/");
    String pubId = parts[5];
    String price = parts[6];
    String lat = parts[7];
    String lon = parts[8];
    String adId = parts[9];
    String cridId = parts[10];
    String hash = parts[11];
    hash = hash.replaceAll("%23", "#");
    if (image != null)
        image = decoder.decode(image, "UTF-8");
    forward = decoder.decode(forward, "UTF-8");
    String cost = "";
    /*
		 * This is synthetic, because in reality, adx has no win notification,
		 * this is a fake pixel fire that does the work
		 */
    if (pubId.equals(AdxBidRequest.ADX)) {
        Long value = AdxWinObject.decrypt(price, System.currentTimeMillis());
        Double dv = new Double(value);
        dv /= 1000000;
        convertBidToWin(hash, cost, lat, lon, adId, cridId, pubId, image, forward, dv.toString(), pubId);
        BidRequest.incrementWins(pubId);
        return "";
    }
    if (pubId.equals(OpenRTB.GOOGLE)) {
        Double dv = GoogleWinObject.decrypt(price, System.currentTimeMillis());
        dv /= 1000;
        convertBidToWin(hash, cost, lat, lon, adId, cridId, pubId, image, forward, dv.toString(), pubId);
        BidRequest.incrementWins(pubId);
        return "";
    }
    Map bid = null;
    try {
        bid = Controller.getInstance().getBidData(hash);
    } catch (Exception error) {
        AerospikeHandler.reset();
        return "";
    }
    // if (bid == null || bid.isEmpty()) {
    // throw new Exception("No bid to convert to win: " + hash);
    // }
    String adm = null;
    try {
        adm = (String) bid.get("ADM");
        cost = (String) bid.get("PRICE");
    } catch (Exception error) {
    // System.out.println("-----------> " + bid);
    }
    // the accounting works. just return ""
    try {
        convertBidToWin(hash, cost, lat, lon, adId, cridId, pubId, image, forward, price, adm);
    } catch (Exception error) {
        Controller.getInstance().sendLog(1, "WinObject:convertBidToWin", "Error: " + error.toString() + ", target = " + target);
    }
    BidRequest.incrementWins(pubId);
    if (adm == null) {
        return "";
    }
    return adm;
}
Also used : Map(java.util.Map) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 9 with JsonIgnore

use of com.fasterxml.jackson.annotation.JsonIgnore in project killbill by killbill.

the class NodeInterval method isPartitionedByChildren.

@JsonIgnore
public boolean isPartitionedByChildren() {
    if (leftChild == null) {
        return false;
    }
    LocalDate curDate = start;
    NodeInterval curChild = leftChild;
    while (curChild != null) {
        if (curChild.getStart().compareTo(curDate) > 0) {
            return false;
        }
        curDate = curChild.getEnd();
        curChild = curChild.getRightSibling();
    }
    return (curDate.compareTo(end) == 0);
}
Also used : LocalDate(org.joda.time.LocalDate) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Example 10 with JsonIgnore

use of com.fasterxml.jackson.annotation.JsonIgnore in project ambrose by twitter.

the class CascadingJob method setJobStats.

@JsonIgnore
public void setJobStats(HadoopStepStats stats) {
    Counters counters = new Counters();
    for (String groupName : stats.getCounterGroups()) {
        for (String counterName : stats.getCountersFor(groupName)) {
            Long counterValue = stats.getCounterValue(groupName, counterName);
            counters.findCounter(groupName, counterName).setValue(counterValue);
        }
    }
    setCounterGroupMap(CounterGroup.counterGroupsByName(counters));
}
Also used : Counters(org.apache.hadoop.mapred.Counters) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Aggregations

JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)15 EntitlementException (com.sun.identity.entitlement.EntitlementException)3 PolicyException (com.sun.identity.policy.PolicyException)3 SSOException (com.iplanet.sso.SSOException)2 File (java.io.File)2 PathFinder (ml.shifu.shifu.fs.PathFinder)2 Path (org.apache.hadoop.fs.Path)2 Counters (org.apache.hadoop.mapred.Counters)2 JSONException (org.json.JSONException)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 EntitlementSubject (com.sun.identity.entitlement.EntitlementSubject)1 Condition (com.sun.identity.policy.interfaces.Condition)1 ResponseProvider (com.sun.identity.policy.interfaces.ResponseProvider)1 Subject (com.sun.identity.policy.interfaces.Subject)1 ResourceType (com.yahoo.pulsar.common.policies.data.loadbalancer.SystemResourceUsage.ResourceType)1 DimensionsSpec (io.druid.data.input.impl.DimensionsSpec)1 InputRowParser (io.druid.data.input.impl.InputRowParser)1 TimestampSpec (io.druid.data.input.impl.TimestampSpec)1 IAE (io.druid.java.util.common.IAE)1 AggregatorFactory (io.druid.query.aggregation.AggregatorFactory)1