use of org.javatuples.Pair in project janusgraph by JanusGraph.
the class HasStepFolder method validJanusGraphOrder.
static boolean validJanusGraphOrder(OrderGlobalStep orderGlobalStep, Traversal rootTraversal, boolean isVertexOrder) {
final List<Pair<Traversal.Admin, Object>> comparators = orderGlobalStep.getComparators();
for (Pair<Traversal.Admin, Object> comp : comparators) {
if (comp.getValue0() instanceof ElementValueTraversal && comp.getValue1() instanceof Order) {
final String key = ((ElementValueTraversal) comp.getValue0()).getPropertyKey();
final JanusGraphTransaction tx = JanusGraphTraversalUtil.getTx(rootTraversal.asAdmin());
final PropertyKey pKey = tx.getPropertyKey(key);
if (pKey == null || !(Comparable.class.isAssignableFrom(pKey.dataType())) || (isVertexOrder && pKey.cardinality() != Cardinality.SINGLE)) {
return false;
}
} else {
// do not fold comparators that include nested traversals that are not simple ElementValues
return false;
}
}
return true;
}
use of org.javatuples.Pair in project oxTrust by GluuFederation.
the class SvnSyncTimer method init.
@PostConstruct
public void init() {
this.isActive = new AtomicBoolean(true);
try {
this.removedTrustRelationship = new LinkedBlockingQueue<Pair<GluuSAMLTrustRelationship, String>>();
this.alteredTrustRelations = new ArrayList<Pair<GluuSAMLTrustRelationship, String>>();
} finally {
this.isActive.set(false);
}
}
use of org.javatuples.Pair in project jPOS by jpos.
the class JCESecurityModule method translatePINGenerateSM_MACImpl.
@Override
protected Pair<EncryptedPIN, byte[]> translatePINGenerateSM_MACImpl(MKDMethod mkdm, SKDMethod skdm, PaddingMethod padm, SecureDESKey imksmi, String accountNo, String accntSeqNo, byte[] atc, byte[] arqc, byte[] data, EncryptedPIN currentPIN, EncryptedPIN newPIN, SecureDESKey kd1, SecureDESKey imksmc, SecureDESKey imkac, byte destinationPINBlockFormat) throws SMException {
if (mkdm == null)
mkdm = MKDMethod.OPTION_A;
byte[] panpsn = formatPANPSN(accountNo, accntSeqNo, mkdm);
Key mksmc = deriveICCMasterKey(decryptFromLMK(imksmc), panpsn);
Key smc;
PaddingMethod derivedPADM;
switch(skdm) {
case VSDC:
smc = deriveSK_VISA(mksmc, atc);
derivedPADM = PaddingMethod.VSDC;
break;
case MCHIP:
smc = deriveCommonSK_SM(mksmc, arqc);
derivedPADM = PaddingMethod.MCHIP;
break;
case EMV_CSKD:
smc = deriveCommonSK_SM(mksmc, arqc);
derivedPADM = PaddingMethod.CCD;
break;
default:
throw new SMException("Session Key Derivation " + skdm + " not supported");
}
// Use derived Padding Method if not specified
if (padm == null)
padm = derivedPADM;
Key udk = null;
if (isVSDCPinBlockFormat(destinationPINBlockFormat))
udk = deriveICCMasterKey(decryptFromLMK(imkac), panpsn);
EncryptedPIN pin = translatePINExt(currentPIN, newPIN, decryptFromLMK(kd1), smc, destinationPINBlockFormat, udk, padm);
data = ISOUtil.concat(data, pin.getPINBlock());
byte[] mac = generateSM_MACImpl(mkdm, skdm, imksmi, accountNo, accntSeqNo, atc, arqc, data);
return new Pair(pin, mac);
}
Aggregations