text
stringlengths 2
1.04M
| meta
dict |
---|---|
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// CommonJS
factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var pluses = /\+/g;
function encode(s) {
return config.raw ? s : encodeURIComponent(s);
}
function decode(s) {
return config.raw ? s : decodeURIComponent(s);
}
function stringifyCookieValue(value) {
return encode(config.json ? JSON.stringify(value) : String(value));
}
function parseCookieValue(s) {
if (s.indexOf('"') === 0) {
// This is a quoted cookie as according to RFC2068, unescape...
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
}
try {
// Replace server-side written pluses with spaces.
// If we can't decode the cookie, ignore it, it's unusable.
// If we can't parse the cookie, ignore it, it's unusable.
s = decodeURIComponent(s.replace(pluses, ' '));
return config.json ? JSON.parse(s) : s;
} catch(e) {}
}
function read(s, converter) {
var value = config.raw ? s : parseCookieValue(s);
return $.isFunction(converter) ? converter(value) : value;
}
var config = $.cookie = function (key, value, options) {
// Write
if (value !== undefined && !$.isFunction(value)) {
options = $.extend({}, config.defaults, options);
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setTime(+t + days * 864e+5);
}
return (document.cookie = [
encode(key), '=', stringifyCookieValue(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// Read
var result = key ? undefined : {};
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling $.cookie().
var cookies = document.cookie ? document.cookie.split('; ') : [];
for (var i = 0, l = cookies.length; i < l; i++) {
var parts = cookies[i].split('=');
var name = decode(parts.shift());
var cookie = parts.join('=');
if (key && key === name) {
// If second argument (value) is a function it's a converter...
result = read(cookie, value);
break;
}
// Prevent storing a cookie that we couldn't decode.
if (!key && (cookie = read(cookie)) !== undefined) {
result[name] = cookie;
}
}
return result;
};
config.defaults = {};
$.removeCookie = function (key, options) {
if ($.cookie(key) === undefined) {
return false;
}
// Must not alter options, thus extending a fresh object...
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
return !$.cookie(key);
};
})); | {
"content_hash": "1bea8dddefe9c31c5111780a692073f4",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 129,
"avg_line_length": 27.74774774774775,
"alnum_prop": 0.5824675324675325,
"repo_name": "lvalenzuela/infinithink",
"id": "3638af8b9b99b4e8012ab99475a83a5a9d607753",
"size": "3236",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "content/themes/Brooklyn/brooklyn/admin/assets/js/jquery.ckie.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2836109"
},
{
"name": "HTML",
"bytes": "732616"
},
{
"name": "JavaScript",
"bytes": "2735803"
},
{
"name": "PHP",
"bytes": "8532433"
},
{
"name": "Ruby",
"bytes": "5765"
},
{
"name": "Shell",
"bytes": "185"
}
],
"symlink_target": ""
} |
package com.marklogic.client.admin.config.support;
import com.marklogic.client.admin.config.QueryOptions.Field;
import com.marklogic.client.admin.config.QueryOptions.JsonKey;
import com.marklogic.client.admin.config.QueryOptions.MarkLogicQName;
import com.marklogic.client.admin.config.QueryOptions.PathIndex;
/**
* Marks classes that are backed by MarkLogic indexes.
* Used to support {@link com.marklogic.client.admin.config.QueryOptionsBuilder} expressions.
*/
@SuppressWarnings("deprecation")
public interface Indexed {
void setField(Field field);
void setAttribute(MarkLogicQName attribute);
void setElement(MarkLogicQName element);
void setJsonKey(JsonKey jsonKey);
void setPath(PathIndex path);
}
| {
"content_hash": "7bab291a077cff4ef4f327de24d96027",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 93,
"avg_line_length": 26.74074074074074,
"alnum_prop": 0.8060941828254847,
"repo_name": "supriyantomaftuh/java-client-api",
"id": "ff4541afb96e92b850128f232221ab97cd695f13",
"size": "1330",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/com/marklogic/client/admin/config/support/Indexed.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "441"
},
{
"name": "Java",
"bytes": "4425096"
},
{
"name": "JavaScript",
"bytes": "4432"
},
{
"name": "Shell",
"bytes": "1782"
},
{
"name": "XQuery",
"bytes": "94511"
},
{
"name": "XSLT",
"bytes": "5634"
}
],
"symlink_target": ""
} |
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/privacy/dlp/v2/dlp.proto
package com.google.privacy.dlp.v2;
public interface InspectionRuleOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.InspectionRule)
com.google.protobuf.MessageOrBuilder {
/**
*
*
* <pre>
* Hotword-based detection rule.
* </pre>
*
* <code>.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule hotword_rule = 1;</code>
*
* @return Whether the hotwordRule field is set.
*/
boolean hasHotwordRule();
/**
*
*
* <pre>
* Hotword-based detection rule.
* </pre>
*
* <code>.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule hotword_rule = 1;</code>
*
* @return The hotwordRule.
*/
com.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule getHotwordRule();
/**
*
*
* <pre>
* Hotword-based detection rule.
* </pre>
*
* <code>.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRule hotword_rule = 1;</code>
*/
com.google.privacy.dlp.v2.CustomInfoType.DetectionRule.HotwordRuleOrBuilder
getHotwordRuleOrBuilder();
/**
*
*
* <pre>
* Exclusion rule.
* </pre>
*
* <code>.google.privacy.dlp.v2.ExclusionRule exclusion_rule = 2;</code>
*
* @return Whether the exclusionRule field is set.
*/
boolean hasExclusionRule();
/**
*
*
* <pre>
* Exclusion rule.
* </pre>
*
* <code>.google.privacy.dlp.v2.ExclusionRule exclusion_rule = 2;</code>
*
* @return The exclusionRule.
*/
com.google.privacy.dlp.v2.ExclusionRule getExclusionRule();
/**
*
*
* <pre>
* Exclusion rule.
* </pre>
*
* <code>.google.privacy.dlp.v2.ExclusionRule exclusion_rule = 2;</code>
*/
com.google.privacy.dlp.v2.ExclusionRuleOrBuilder getExclusionRuleOrBuilder();
public com.google.privacy.dlp.v2.InspectionRule.TypeCase getTypeCase();
}
| {
"content_hash": "ad8bbe5857b499916b6f039553d94d47",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 99,
"avg_line_length": 23.583333333333332,
"alnum_prop": 0.6521958606764261,
"repo_name": "googleapis/java-dlp",
"id": "676fe9b7da7706fae13e7eb7d3b8ce82886770a9",
"size": "2575",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/InspectionRuleOrBuilder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "801"
},
{
"name": "Java",
"bytes": "12264243"
},
{
"name": "Python",
"bytes": "2548"
},
{
"name": "Shell",
"bytes": "22242"
}
],
"symlink_target": ""
} |
<div class="wikistyle">
<h1>jquery carousel</h1>
<a href="http://orzpoint.com/demos/jquery-carousel/i.html">View Demo</a>
</div>
| {
"content_hash": "f2e6616c492554d384c3518c9991518c",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 73,
"avg_line_length": 32.75,
"alnum_prop": 0.6946564885496184,
"repo_name": "aobo711/jQuery-Carousel",
"id": "6914ab45af08a52df414e15d55e82de2c19e8152",
"size": "131",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "16183"
}
],
"symlink_target": ""
} |
"use strict";
module.exports = MediaQuery;
var SyntaxUnit = require("../util/SyntaxUnit");
var Parser = require("./Parser");
/**
* Represents an individual media query.
* @namespace parserlib.css
* @class MediaQuery
* @extends parserlib.util.SyntaxUnit
* @constructor
* @param {String} modifier The modifier "not" or "only" (or null).
* @param {String} mediaType The type of media (i.e., "print").
* @param {Array} parts Array of selectors parts making up this selector.
* @param {int} line The line of text on which the unit resides.
* @param {int} col The column of text on which the unit resides.
*/
function MediaQuery(modifier, mediaType, features, line, col) {
SyntaxUnit.call(this, (modifier ? modifier + " ": "") + (mediaType ? mediaType : "") + (mediaType && features.length > 0 ? " and " : "") + features.join(" and "), line, col, Parser.MEDIA_QUERY_TYPE);
/**
* The media modifier ("not" or "only")
* @type String
* @property modifier
*/
this.modifier = modifier;
/**
* The mediaType (i.e., "print")
* @type String
* @property mediaType
*/
this.mediaType = mediaType;
/**
* The parts that make up the selector.
* @type Array
* @property features
*/
this.features = features;
}
MediaQuery.prototype = new SyntaxUnit();
MediaQuery.prototype.constructor = MediaQuery;
| {
"content_hash": "824a641115391b46320697790dca4858",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 203,
"avg_line_length": 27.72,
"alnum_prop": 0.6406926406926406,
"repo_name": "RaresO/test",
"id": "46476df6da0797b0d39f23cd665bae7aaa71b554",
"size": "1386",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "node_modules/parserlib/src/css/MediaQuery.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1477"
},
{
"name": "HTML",
"bytes": "41457"
},
{
"name": "JavaScript",
"bytes": "377307"
},
{
"name": "Shell",
"bytes": "4577"
}
],
"symlink_target": ""
} |
/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
Copyright (C) 2009 Red Hat, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef QUIC_RGB32
#undef QUIC_RGB32
#define PIXEL rgb32_pixel_t
#define FNAME(name) quic_rgb32_##name
#define golomb_coding golomb_coding_8bpc
#define golomb_decoding golomb_decoding_8bpc
#define update_model update_model_8bpc
#define find_bucket find_bucket_8bpc
#define family family_8bpc
#define BPC 8
#define BPC_MASK 0xffU
#define COMPRESS_IMP
#define SET_r(pix, val) ((pix)->r = val)
#define GET_r(pix) ((pix)->r)
#define SET_g(pix, val) ((pix)->g = val)
#define GET_g(pix) ((pix)->g)
#define SET_b(pix, val) ((pix)->b = val)
#define GET_b(pix) ((pix)->b)
#define UNCOMPRESS_PIX_START(pix) ((pix)->pad = 0)
#endif
#ifdef QUIC_RGB24
#undef QUIC_RGB24
#define PIXEL rgb24_pixel_t
#define FNAME(name) quic_rgb24_##name
#define golomb_coding golomb_coding_8bpc
#define golomb_decoding golomb_decoding_8bpc
#define update_model update_model_8bpc
#define find_bucket find_bucket_8bpc
#define family family_8bpc
#define BPC 8
#define BPC_MASK 0xffU
#define COMPRESS_IMP
#define SET_r(pix, val) ((pix)->r = val)
#define GET_r(pix) ((pix)->r)
#define SET_g(pix, val) ((pix)->g = val)
#define GET_g(pix) ((pix)->g)
#define SET_b(pix, val) ((pix)->b = val)
#define GET_b(pix) ((pix)->b)
#define UNCOMPRESS_PIX_START(pix)
#endif
#ifdef QUIC_RGB16
#undef QUIC_RGB16
#define PIXEL rgb16_pixel_t
#define FNAME(name) quic_rgb16_##name
#define golomb_coding golomb_coding_5bpc
#define golomb_decoding golomb_decoding_5bpc
#define update_model update_model_5bpc
#define find_bucket find_bucket_5bpc
#define family family_5bpc
#define BPC 5
#define BPC_MASK 0x1fU
#define COMPRESS_IMP
#define SET_r(pix, val) (*(pix) = (*(pix) & ~(0x1f << 10)) | ((val) << 10))
#define GET_r(pix) ((*(pix) >> 10) & 0x1f)
#define SET_g(pix, val) (*(pix) = (*(pix) & ~(0x1f << 5)) | ((val) << 5))
#define GET_g(pix) ((*(pix) >> 5) & 0x1f)
#define SET_b(pix, val) (*(pix) = (*(pix) & ~0x1f) | (val))
#define GET_b(pix) (*(pix) & 0x1f)
#define UNCOMPRESS_PIX_START(pix) (*(pix) = 0)
#endif
#ifdef QUIC_RGB16_TO_32
#undef QUIC_RGB16_TO_32
#define PIXEL rgb32_pixel_t
#define FNAME(name) quic_rgb16_to_32_##name
#define golomb_coding golomb_coding_5bpc
#define golomb_decoding golomb_decoding_5bpc
#define update_model update_model_5bpc
#define find_bucket find_bucket_5bpc
#define family family_5bpc
#define BPC 5
#define BPC_MASK 0x1fU
#define SET_r(pix, val) ((pix)->r = ((val) << 3) | (((val) & 0x1f) >> 2))
#define GET_r(pix) ((pix)->r >> 3)
#define SET_g(pix, val) ((pix)->g = ((val) << 3) | (((val) & 0x1f) >> 2))
#define GET_g(pix) ((pix)->g >> 3)
#define SET_b(pix, val) ((pix)->b = ((val) << 3) | (((val) & 0x1f) >> 2))
#define GET_b(pix) ((pix)->b >> 3)
#define UNCOMPRESS_PIX_START(pix) ((pix)->pad = 0)
#endif
#define SAME_PIXEL(p1, p2) \
(GET_r(p1) == GET_r(p2) && GET_g(p1) == GET_g(p2) && \
GET_b(p1) == GET_b(p2))
#define _PIXEL_A(channel, curr) ((unsigned int)GET_##channel((curr) - 1))
#define _PIXEL_B(channel, prev) ((unsigned int)GET_##channel(prev))
#define _PIXEL_C(channel, prev) ((unsigned int)GET_##channel((prev) - 1))
/* a */
#define DECORELATE_0(channel, curr, bpc_mask)\
family.xlatU2L[(unsigned)((int)GET_##channel(curr) - (int)_PIXEL_A(channel, curr)) & bpc_mask]
#define CORELATE_0(channel, curr, correlate, bpc_mask)\
((family.xlatL2U[correlate] + _PIXEL_A(channel, curr)) & bpc_mask)
#ifdef PRED_1
/* (a+b)/2 */
#define DECORELATE(channel, prev, curr, bpc_mask, r) \
r = family.xlatU2L[(unsigned)((int)GET_##channel(curr) - (int)((_PIXEL_A(channel, curr) + \
_PIXEL_B(channel, prev)) >> 1)) & bpc_mask]
#define CORELATE(channel, prev, curr, correlate, bpc_mask, r) \
SET_##channel(r, ((family.xlatL2U[correlate] + \
(int)((_PIXEL_A(channel, curr) + _PIXEL_B(channel, prev)) >> 1)) & bpc_mask))
#endif
#ifdef PRED_2
/* .75a+.75b-.5c */
#define DECORELATE(channel, prev, curr, bpc_mask, r) { \
int p = ((int)(3 * (_PIXEL_A(channel, curr) + _PIXEL_B(channel, prev))) - \
(int)(_PIXEL_C(channel, prev) << 1)) >> 2; \
if (p < 0) { \
p = 0; \
} else if ((unsigned)p > bpc_mask) { \
p = bpc_mask; \
} \
r = family.xlatU2L[(unsigned)((int)GET_##channel(curr) - p) & bpc_mask]; \
}
#define CORELATE(channel, prev, curr, correlate, bpc_mask, r) { \
const int p = ((int)(3 * (_PIXEL_A(channel, curr) + _PIXEL_B(channel, prev))) - \
(int)(_PIXEL_C(channel, prev) << 1) ) >> 2; \
const unsigned int s = family.xlatL2U[correlate]; \
if (!(p & ~bpc_mask)) { \
SET_##channel(r, (s + (unsigned)p) & bpc_mask); \
} else if (p < 0) { \
SET_##channel(r, s); \
} else { \
SET_##channel(r, (s + bpc_mask) & bpc_mask); \
} \
}
#endif
#define COMPRESS_ONE_ROW0_0(channel) \
correlate_row_##channel[0] = family.xlatU2L[GET_##channel(cur_row)]; \
golomb_coding(correlate_row_##channel[0], find_bucket(channel_##channel, \
correlate_row_##channel[-1])->bestcode, \
&codeword, &codewordlen); \
encode(encoder, codeword, codewordlen);
#define COMPRESS_ONE_ROW0(channel, index) \
correlate_row_##channel[index] = DECORELATE_0(channel, &cur_row[index], bpc_mask); \
golomb_coding(correlate_row_##channel[index], find_bucket(channel_##channel, \
correlate_row_##channel[index -1])->bestcode, \
&codeword, &codewordlen); \
encode(encoder, codeword, codewordlen);
#define UPDATE_MODEL(index) \
update_model(&encoder->rgb_state, find_bucket(channel_r, correlate_row_r[index - 1]), \
correlate_row_r[index]); \
update_model(&encoder->rgb_state, find_bucket(channel_g, correlate_row_g[index - 1]), \
correlate_row_g[index]); \
update_model(&encoder->rgb_state, find_bucket(channel_b, correlate_row_b[index - 1]), \
correlate_row_b[index]);
#ifdef RLE_PRED_1
#define RLE_PRED_1_IMP \
if (SAME_PIXEL(&cur_row[i - 1], &prev_row[i])) { \
if (run_index != i && SAME_PIXEL(&prev_row[i - 1], &prev_row[i]) && \
i + 1 < end && SAME_PIXEL(&prev_row[i], &prev_row[i + 1])) { \
goto do_run; \
} \
}
#else
#define RLE_PRED_1_IMP
#endif
#ifdef RLE_PRED_2
#define RLE_PRED_2_IMP \
if (SAME_PIXEL(&prev_row[i - 1], &prev_row[i])) { \
if (run_index != i && i > 2 && SAME_PIXEL(&cur_row[i - 1], &cur_row[i - 2])) { \
goto do_run; \
} \
}
#else
#define RLE_PRED_2_IMP
#endif
#ifdef RLE_PRED_3
#define RLE_PRED_3_IMP \
if (i > 1 && SAME_PIXEL(&cur_row[i - 1], &cur_row[i - 2]) && i != run_index) { \
goto do_run; \
}
#else
#define RLE_PRED_3_IMP
#endif
#ifdef COMPRESS_IMP
static void FNAME(compress_row0_seg)(Encoder *encoder, int i,
const PIXEL * const cur_row,
const int end,
const unsigned int waitmask,
const unsigned int bpc,
const unsigned int bpc_mask)
{
Channel * const channel_r = encoder->channels;
Channel * const channel_g = channel_r + 1;
Channel * const channel_b = channel_g + 1;
BYTE * const correlate_row_r = channel_r->correlate_row;
BYTE * const correlate_row_g = channel_g->correlate_row;
BYTE * const correlate_row_b = channel_b->correlate_row;
int stopidx;
spice_assert(end - i > 0);
if (!i) {
unsigned int codeword, codewordlen;
COMPRESS_ONE_ROW0_0(r);
COMPRESS_ONE_ROW0_0(g);
COMPRESS_ONE_ROW0_0(b);
if (encoder->rgb_state.waitcnt) {
encoder->rgb_state.waitcnt--;
} else {
encoder->rgb_state.waitcnt = (tabrand(&encoder->rgb_state.tabrand_seed) & waitmask);
UPDATE_MODEL(0);
}
stopidx = ++i + encoder->rgb_state.waitcnt;
} else {
stopidx = i + encoder->rgb_state.waitcnt;
}
while (stopidx < end) {
for (; i <= stopidx; i++) {
unsigned int codeword, codewordlen;
COMPRESS_ONE_ROW0(r, i);
COMPRESS_ONE_ROW0(g, i);
COMPRESS_ONE_ROW0(b, i);
}
UPDATE_MODEL(stopidx);
stopidx = i + (tabrand(&encoder->rgb_state.tabrand_seed) & waitmask);
}
for (; i < end; i++) {
unsigned int codeword, codewordlen;
COMPRESS_ONE_ROW0(r, i);
COMPRESS_ONE_ROW0(g, i);
COMPRESS_ONE_ROW0(b, i);
}
encoder->rgb_state.waitcnt = stopidx - end;
}
static void FNAME(compress_row0)(Encoder *encoder, const PIXEL *cur_row,
unsigned int width)
{
const unsigned int bpc = BPC;
const unsigned int bpc_mask = BPC_MASK;
int pos = 0;
while ((wmimax > (int)encoder->rgb_state.wmidx) && (encoder->rgb_state.wmileft <= width)) {
if (encoder->rgb_state.wmileft) {
FNAME(compress_row0_seg)(encoder, pos, cur_row, pos + encoder->rgb_state.wmileft,
bppmask[encoder->rgb_state.wmidx], bpc, bpc_mask);
width -= encoder->rgb_state.wmileft;
pos += encoder->rgb_state.wmileft;
}
encoder->rgb_state.wmidx++;
set_wm_trigger(&encoder->rgb_state);
encoder->rgb_state.wmileft = wminext;
}
if (width) {
FNAME(compress_row0_seg)(encoder, pos, cur_row, pos + width,
bppmask[encoder->rgb_state.wmidx], bpc, bpc_mask);
if (wmimax > (int)encoder->rgb_state.wmidx) {
encoder->rgb_state.wmileft -= width;
}
}
spice_assert((int)encoder->rgb_state.wmidx <= wmimax);
spice_assert(encoder->rgb_state.wmidx <= 32);
spice_assert(wminext > 0);
}
#define COMPRESS_ONE_0(channel) \
correlate_row_##channel[0] = family.xlatU2L[(unsigned)((int)GET_##channel(cur_row) - \
(int)GET_##channel(prev_row) ) & bpc_mask]; \
golomb_coding(correlate_row_##channel[0], \
find_bucket(channel_##channel, correlate_row_##channel[-1])->bestcode, \
&codeword, &codewordlen); \
encode(encoder, codeword, codewordlen);
#define COMPRESS_ONE(channel, index) \
DECORELATE(channel, &prev_row[index], &cur_row[index],bpc_mask, \
correlate_row_##channel[index]); \
golomb_coding(correlate_row_##channel[index], \
find_bucket(channel_##channel, correlate_row_##channel[index - 1])->bestcode, \
&codeword, &codewordlen); \
encode(encoder, codeword, codewordlen);
static void FNAME(compress_row_seg)(Encoder *encoder, int i,
const PIXEL * const prev_row,
const PIXEL * const cur_row,
const int end,
const unsigned int waitmask,
const unsigned int bpc,
const unsigned int bpc_mask)
{
Channel * const channel_r = encoder->channels;
Channel * const channel_g = channel_r + 1;
Channel * const channel_b = channel_g + 1;
BYTE * const correlate_row_r = channel_r->correlate_row;
BYTE * const correlate_row_g = channel_g->correlate_row;
BYTE * const correlate_row_b = channel_b->correlate_row;
int stopidx;
#ifdef RLE
int run_index = 0;
int run_size;
#endif
spice_assert(end - i > 0);
if (!i) {
unsigned int codeword, codewordlen;
COMPRESS_ONE_0(r);
COMPRESS_ONE_0(g);
COMPRESS_ONE_0(b);
if (encoder->rgb_state.waitcnt) {
encoder->rgb_state.waitcnt--;
} else {
encoder->rgb_state.waitcnt = (tabrand(&encoder->rgb_state.tabrand_seed) & waitmask);
UPDATE_MODEL(0);
}
stopidx = ++i + encoder->rgb_state.waitcnt;
} else {
stopidx = i + encoder->rgb_state.waitcnt;
}
for (;;) {
while (stopidx < end) {
for (; i <= stopidx; i++) {
unsigned int codeword, codewordlen;
#ifdef RLE
RLE_PRED_1_IMP;
RLE_PRED_2_IMP;
RLE_PRED_3_IMP;
#endif
COMPRESS_ONE(r, i);
COMPRESS_ONE(g, i);
COMPRESS_ONE(b, i);
}
UPDATE_MODEL(stopidx);
stopidx = i + (tabrand(&encoder->rgb_state.tabrand_seed) & waitmask);
}
for (; i < end; i++) {
unsigned int codeword, codewordlen;
#ifdef RLE
RLE_PRED_1_IMP;
RLE_PRED_2_IMP;
RLE_PRED_3_IMP;
#endif
COMPRESS_ONE(r, i);
COMPRESS_ONE(g, i);
COMPRESS_ONE(b, i);
}
encoder->rgb_state.waitcnt = stopidx - end;
return;
#ifdef RLE
do_run:
run_index = i;
encoder->rgb_state.waitcnt = stopidx - i;
run_size = 0;
while (SAME_PIXEL(&cur_row[i], &cur_row[i - 1])) {
run_size++;
if (++i == end) {
encode_run(encoder, run_size);
return;
}
}
encode_run(encoder, run_size);
stopidx = i + encoder->rgb_state.waitcnt;
#endif
}
}
static void FNAME(compress_row)(Encoder *encoder,
const PIXEL * const prev_row,
const PIXEL * const cur_row,
unsigned int width)
{
const unsigned int bpc = BPC;
const unsigned int bpc_mask = BPC_MASK;
unsigned int pos = 0;
while ((wmimax > (int)encoder->rgb_state.wmidx) && (encoder->rgb_state.wmileft <= width)) {
if (encoder->rgb_state.wmileft) {
FNAME(compress_row_seg)(encoder, pos, prev_row, cur_row,
pos + encoder->rgb_state.wmileft,
bppmask[encoder->rgb_state.wmidx],
bpc, bpc_mask);
width -= encoder->rgb_state.wmileft;
pos += encoder->rgb_state.wmileft;
}
encoder->rgb_state.wmidx++;
set_wm_trigger(&encoder->rgb_state);
encoder->rgb_state.wmileft = wminext;
}
if (width) {
FNAME(compress_row_seg)(encoder, pos, prev_row, cur_row, pos + width,
bppmask[encoder->rgb_state.wmidx], bpc, bpc_mask);
if (wmimax > (int)encoder->rgb_state.wmidx) {
encoder->rgb_state.wmileft -= width;
}
}
spice_assert((int)encoder->rgb_state.wmidx <= wmimax);
spice_assert(encoder->rgb_state.wmidx <= 32);
spice_assert(wminext > 0);
}
#endif
#define UNCOMPRESS_ONE_ROW0_0(channel) \
correlate_row_##channel[0] = (BYTE)golomb_decoding(find_bucket(channel_##channel, \
correlate_row_##channel[-1])->bestcode, \
encoder->io_word, &codewordlen); \
SET_##channel(&cur_row[0], (BYTE)family.xlatL2U[correlate_row_##channel[0]]); \
decode_eatbits(encoder, codewordlen);
#define UNCOMPRESS_ONE_ROW0(channel) \
correlate_row_##channel[i] = (BYTE)golomb_decoding(find_bucket(channel_##channel, \
correlate_row_##channel[i - 1])->bestcode, \
encoder->io_word, \
&codewordlen); \
SET_##channel(&cur_row[i], CORELATE_0(channel, &cur_row[i], correlate_row_##channel[i], \
bpc_mask)); \
decode_eatbits(encoder, codewordlen);
static void FNAME(uncompress_row0_seg)(Encoder *encoder, int i,
PIXEL * const cur_row,
const int end,
const unsigned int waitmask,
const unsigned int bpc,
const unsigned int bpc_mask)
{
Channel * const channel_r = encoder->channels;
Channel * const channel_g = channel_r + 1;
Channel * const channel_b = channel_g + 1;
BYTE * const correlate_row_r = channel_r->correlate_row;
BYTE * const correlate_row_g = channel_g->correlate_row;
BYTE * const correlate_row_b = channel_b->correlate_row;
int stopidx;
spice_assert(end - i > 0);
if (!i) {
unsigned int codewordlen;
UNCOMPRESS_PIX_START(&cur_row[i]);
UNCOMPRESS_ONE_ROW0_0(r);
UNCOMPRESS_ONE_ROW0_0(g);
UNCOMPRESS_ONE_ROW0_0(b);
if (encoder->rgb_state.waitcnt) {
--encoder->rgb_state.waitcnt;
} else {
encoder->rgb_state.waitcnt = (tabrand(&encoder->rgb_state.tabrand_seed) & waitmask);
UPDATE_MODEL(0);
}
stopidx = ++i + encoder->rgb_state.waitcnt;
} else {
stopidx = i + encoder->rgb_state.waitcnt;
}
while (stopidx < end) {
for (; i <= stopidx; i++) {
unsigned int codewordlen;
UNCOMPRESS_PIX_START(&cur_row[i]);
UNCOMPRESS_ONE_ROW0(r);
UNCOMPRESS_ONE_ROW0(g);
UNCOMPRESS_ONE_ROW0(b);
}
UPDATE_MODEL(stopidx);
stopidx = i + (tabrand(&encoder->rgb_state.tabrand_seed) & waitmask);
}
for (; i < end; i++) {
unsigned int codewordlen;
UNCOMPRESS_PIX_START(&cur_row[i]);
UNCOMPRESS_ONE_ROW0(r);
UNCOMPRESS_ONE_ROW0(g);
UNCOMPRESS_ONE_ROW0(b);
}
encoder->rgb_state.waitcnt = stopidx - end;
}
static void FNAME(uncompress_row0)(Encoder *encoder,
PIXEL * const cur_row,
unsigned int width)
{
const unsigned int bpc = BPC;
const unsigned int bpc_mask = BPC_MASK;
unsigned int pos = 0;
while ((wmimax > (int)encoder->rgb_state.wmidx) && (encoder->rgb_state.wmileft <= width)) {
if (encoder->rgb_state.wmileft) {
FNAME(uncompress_row0_seg)(encoder, pos, cur_row,
pos + encoder->rgb_state.wmileft,
bppmask[encoder->rgb_state.wmidx],
bpc, bpc_mask);
pos += encoder->rgb_state.wmileft;
width -= encoder->rgb_state.wmileft;
}
encoder->rgb_state.wmidx++;
set_wm_trigger(&encoder->rgb_state);
encoder->rgb_state.wmileft = wminext;
}
if (width) {
FNAME(uncompress_row0_seg)(encoder, pos, cur_row, pos + width,
bppmask[encoder->rgb_state.wmidx], bpc, bpc_mask);
if (wmimax > (int)encoder->rgb_state.wmidx) {
encoder->rgb_state.wmileft -= width;
}
}
spice_assert((int)encoder->rgb_state.wmidx <= wmimax);
spice_assert(encoder->rgb_state.wmidx <= 32);
spice_assert(wminext > 0);
}
#define UNCOMPRESS_ONE_0(channel) \
correlate_row_##channel[0] = (BYTE)golomb_decoding(find_bucket(channel_##channel, \
correlate_row_##channel[-1])->bestcode, \
encoder->io_word, &codewordlen); \
SET_##channel(&cur_row[0], (family.xlatL2U[correlate_row_##channel[0]] + \
GET_##channel(prev_row)) & bpc_mask); \
decode_eatbits(encoder, codewordlen);
#define UNCOMPRESS_ONE(channel) \
correlate_row_##channel[i] = (BYTE)golomb_decoding(find_bucket(channel_##channel, \
correlate_row_##channel[i - 1])->bestcode, \
encoder->io_word, \
&codewordlen); \
CORELATE(channel, &prev_row[i], &cur_row[i], correlate_row_##channel[i], bpc_mask, \
&cur_row[i]); \
decode_eatbits(encoder, codewordlen);
static void FNAME(uncompress_row_seg)(Encoder *encoder,
const PIXEL * const prev_row,
PIXEL * const cur_row,
int i,
const int end,
const unsigned int bpc,
const unsigned int bpc_mask)
{
Channel * const channel_r = encoder->channels;
Channel * const channel_g = channel_r + 1;
Channel * const channel_b = channel_g + 1;
BYTE * const correlate_row_r = channel_r->correlate_row;
BYTE * const correlate_row_g = channel_g->correlate_row;
BYTE * const correlate_row_b = channel_b->correlate_row;
const unsigned int waitmask = bppmask[encoder->rgb_state.wmidx];
int stopidx;
#ifdef RLE
int run_index = 0;
int run_end;
#endif
spice_assert(end - i > 0);
if (!i) {
unsigned int codewordlen;
UNCOMPRESS_PIX_START(&cur_row[i]);
UNCOMPRESS_ONE_0(r);
UNCOMPRESS_ONE_0(g);
UNCOMPRESS_ONE_0(b);
if (encoder->rgb_state.waitcnt) {
--encoder->rgb_state.waitcnt;
} else {
encoder->rgb_state.waitcnt = (tabrand(&encoder->rgb_state.tabrand_seed) & waitmask);
UPDATE_MODEL(0);
}
stopidx = ++i + encoder->rgb_state.waitcnt;
} else {
stopidx = i + encoder->rgb_state.waitcnt;
}
for (;;) {
while (stopidx < end) {
for (; i <= stopidx; i++) {
unsigned int codewordlen;
#ifdef RLE
RLE_PRED_1_IMP;
RLE_PRED_2_IMP;
RLE_PRED_3_IMP;
#endif
UNCOMPRESS_PIX_START(&cur_row[i]);
UNCOMPRESS_ONE(r);
UNCOMPRESS_ONE(g);
UNCOMPRESS_ONE(b);
}
UPDATE_MODEL(stopidx);
stopidx = i + (tabrand(&encoder->rgb_state.tabrand_seed) & waitmask);
}
for (; i < end; i++) {
unsigned int codewordlen;
#ifdef RLE
RLE_PRED_1_IMP;
RLE_PRED_2_IMP;
RLE_PRED_3_IMP;
#endif
UNCOMPRESS_PIX_START(&cur_row[i]);
UNCOMPRESS_ONE(r);
UNCOMPRESS_ONE(g);
UNCOMPRESS_ONE(b);
}
encoder->rgb_state.waitcnt = stopidx - end;
return;
#ifdef RLE
do_run:
encoder->rgb_state.waitcnt = stopidx - i;
run_index = i;
run_end = i + decode_run(encoder);
for (; i < run_end; i++) {
UNCOMPRESS_PIX_START(&cur_row[i]);
SET_r(&cur_row[i], GET_r(&cur_row[i - 1]));
SET_g(&cur_row[i], GET_g(&cur_row[i - 1]));
SET_b(&cur_row[i], GET_b(&cur_row[i - 1]));
}
if (i == end) {
return;
}
stopidx = i + encoder->rgb_state.waitcnt;
#endif
}
}
static void FNAME(uncompress_row)(Encoder *encoder,
const PIXEL * const prev_row,
PIXEL * const cur_row,
unsigned int width)
{
const unsigned int bpc = BPC;
const unsigned int bpc_mask = BPC_MASK;
unsigned int pos = 0;
while ((wmimax > (int)encoder->rgb_state.wmidx) && (encoder->rgb_state.wmileft <= width)) {
if (encoder->rgb_state.wmileft) {
FNAME(uncompress_row_seg)(encoder, prev_row, cur_row, pos,
pos + encoder->rgb_state.wmileft, bpc, bpc_mask);
pos += encoder->rgb_state.wmileft;
width -= encoder->rgb_state.wmileft;
}
encoder->rgb_state.wmidx++;
set_wm_trigger(&encoder->rgb_state);
encoder->rgb_state.wmileft = wminext;
}
if (width) {
FNAME(uncompress_row_seg)(encoder, prev_row, cur_row, pos,
pos + width, bpc, bpc_mask);
if (wmimax > (int)encoder->rgb_state.wmidx) {
encoder->rgb_state.wmileft -= width;
}
}
spice_assert((int)encoder->rgb_state.wmidx <= wmimax);
spice_assert(encoder->rgb_state.wmidx <= 32);
spice_assert(wminext > 0);
}
#undef PIXEL
#undef FNAME
#undef _PIXEL_A
#undef _PIXEL_B
#undef _PIXEL_C
#undef SAME_PIXEL
#undef RLE_PRED_1_IMP
#undef RLE_PRED_2_IMP
#undef RLE_PRED_3_IMP
#undef UPDATE_MODEL
#undef DECORELATE_0
#undef DECORELATE
#undef COMPRESS_ONE_ROW0_0
#undef COMPRESS_ONE_ROW0
#undef COMPRESS_ONE_0
#undef COMPRESS_ONE
#undef CORELATE_0
#undef CORELATE
#undef UNCOMPRESS_ONE_ROW0_0
#undef UNCOMPRESS_ONE_ROW0
#undef UNCOMPRESS_ONE_0
#undef UNCOMPRESS_ONE
#undef golomb_coding
#undef golomb_decoding
#undef update_model
#undef find_bucket
#undef family
#undef BPC
#undef BPC_MASK
#undef COMPRESS_IMP
#undef SET_r
#undef GET_r
#undef SET_g
#undef GET_g
#undef SET_b
#undef GET_b
#undef UNCOMPRESS_PIX_START
| {
"content_hash": "43de20791537156ad5e191cdd5cff4d9",
"timestamp": "",
"source": "github",
"line_count": 765,
"max_line_length": 99,
"avg_line_length": 37.50326797385621,
"alnum_prop": 0.4893691181596375,
"repo_name": "x-hansong/aSpice",
"id": "19cc348cbf676c3ee70395201c01f19cdc86d12f",
"size": "28690",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "jni/src/spice-common/common/quic_rgb_tmpl.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "4282962"
},
{
"name": "C++",
"bytes": "121539"
},
{
"name": "Java",
"bytes": "1519371"
},
{
"name": "Makefile",
"bytes": "5040"
},
{
"name": "Objective-C",
"bytes": "30362"
},
{
"name": "Perl",
"bytes": "12169"
},
{
"name": "Shell",
"bytes": "213"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Blackjack")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Blackjack")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "850115f3f6fb46ff9b8527a46b2d3179",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 96,
"avg_line_length": 40.43636363636364,
"alnum_prop": 0.7540467625899281,
"repo_name": "dinazil/she-codes-csharp-for-beginners",
"id": "297a43304d7dfc94c6ced06ac2602273230c4954",
"size": "2227",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Module8/Blackjack/Blackjack/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "71480"
}
],
"symlink_target": ""
} |
from io import StringIO
from antlr4.PredictionContext import PredictionContext, merge
from antlr4.Utils import str_list
from antlr4.atn.ATN import ATN
from antlr4.atn.SemanticContext import SemanticContext
from antlr4.error.Errors import UnsupportedOperationException, IllegalStateException
class ATNConfigSet(object):
#
# The reason that we need this is because we don't want the hash map to use
# the standard hash code and equals. We need all configurations with the same
# {@code (s,i,_,semctx)} to be equal. Unfortunately, this key effectively doubles
# the number of objects associated with ATNConfigs. The other solution is to
# use a hash table that lets us specify the equals/hashcode operation.
def __init__(self, fullCtx=True):
# All configs but hashed by (s, i, _, pi) not including context. Wiped out
# when we go readonly as this set becomes a DFA state.
self.configLookup = set()
# Indicates that this configuration set is part of a full context
# LL prediction. It will be used to determine how to merge $. With SLL
# it's a wildcard whereas it is not for LL context merge.
self.fullCtx = fullCtx
# Indicates that the set of configurations is read-only. Do not
# allow any code to manipulate the set; DFA states will point at
# the sets and they must not change. This does not protect the other
# fields; in particular, conflictingAlts is set after
# we've made this readonly.
self.readonly = False
# Track the elements as they are added to the set; supports get(i)#/
self.configs = []
# TODO: these fields make me pretty uncomfortable but nice to pack up info together, saves recomputation
# TODO: can we track conflicts as they are added to save scanning configs later?
self.uniqueAlt = 0
self.conflictingAlts = None
# Used in parser and lexer. In lexer, it indicates we hit a pred
# while computing a closure operation. Don't make a DFA state from this.
self.hasSemanticContext = False
self.dipsIntoOuterContext = False
self.cachedHashCode = -1
def __iter__(self):
return self.configs.__iter__()
# Adding a new config means merging contexts with existing configs for
# {@code (s, i, pi, _)}, where {@code s} is the
# {@link ATNConfig#state}, {@code i} is the {@link ATNConfig#alt}, and
# {@code pi} is the {@link ATNConfig#semanticContext}. We use
# {@code (s,i,pi)} as key.
#
# <p>This method updates {@link #dipsIntoOuterContext} and
# {@link #hasSemanticContext} when necessary.</p>
#/
def add(self, config, mergeCache=None):
if self.readonly:
raise Exception("This set is readonly")
if config.semanticContext is not SemanticContext.NONE:
self.hasSemanticContext = True
if config.reachesIntoOuterContext > 0:
self.dipsIntoOuterContext = True
existing = self.getOrAdd(config)
if existing is config:
self.cachedHashCode = -1
self.configs.append(config) # track order here
return True
# a previous (s,i,pi,_), merge with it and save result
rootIsWildcard = not self.fullCtx
merged = merge(existing.context, config.context, rootIsWildcard, mergeCache)
# no need to check for existing.context, config.context in cache
# since only way to create new graphs is "call rule" and here. We
# cache at both places.
existing.reachesIntoOuterContext = max(existing.reachesIntoOuterContext, config.reachesIntoOuterContext)
# make sure to preserve the precedence filter suppression during the merge
if config.precedenceFilterSuppressed:
existing.precedenceFilterSuppressed = True
existing.context = merged # replace context; no need to alt mapping
return True
def getOrAdd(self, config):
for c in self.configLookup:
if c==config:
return c
self.configLookup.add(config)
return config
def getStates(self):
states = set()
for c in self.configs:
states.add(c.state)
return states
def getPredicates(self):
preds = list()
for c in self.configs:
if c.semanticContext!=SemanticContext.NONE:
preds.append(c.semanticContext)
return preds
def get(self, i):
return self.configs[i]
def optimizeConfigs(self, interpreter):
if self.readonly:
raise IllegalStateException("This set is readonly")
if len(self.configLookup)==0:
return
for config in self.configs:
config.context = interpreter.getCachedContext(config.context)
def addAll(self, coll):
for c in coll:
self.add(c)
return False
def __eq__(self, other):
if self is other:
return True
elif not isinstance(other, ATNConfigSet):
return False
same = self.configs is not None and \
self.configs==other.configs and \
self.fullCtx == other.fullCtx and \
self.uniqueAlt == other.uniqueAlt and \
self.conflictingAlts == other.conflictingAlts and \
self.hasSemanticContext == other.hasSemanticContext and \
self.dipsIntoOuterContext == other.dipsIntoOuterContext
return same
def __hash__(self):
if self.readonly:
if self.cachedHashCode == -1:
self.cachedHashCode = self.hashConfigs()
return self.cachedHashCode
return self.hashConfigs()
def hashConfigs(self):
with StringIO() as buf:
for cfg in self.configs:
buf.write(unicode(cfg))
return hash(buf.getvalue())
def __len__(self):
return len(self.configs)
def isEmpty(self):
return len(self.configs)==0
def __contains__(self, item):
if self.configLookup is None:
raise UnsupportedOperationException("This method is not implemented for readonly sets.")
return item in self.configLookup
def containsFast(self, obj):
if self.configLookup is None:
raise UnsupportedOperationException("This method is not implemented for readonly sets.")
return self.configLookup.containsFast(obj)
def clear(self):
if self.readonly:
raise IllegalStateException("This set is readonly")
self.configs.clear()
self.cachedHashCode = -1
self.configLookup.clear()
def setReadonly(self, readonly):
self.readonly = readonly
self.configLookup = None # can't mod, no need for lookup cache
def __str__(self):
return unicode(self)
def __unicode__(self):
with StringIO() as buf:
buf.write(str_list(self.configs))
if self.hasSemanticContext:
buf.write(u",hasSemanticContext=")
buf.write(unicode(self.hasSemanticContext))
if self.uniqueAlt!=ATN.INVALID_ALT_NUMBER:
buf.write(u",uniqueAlt=")
buf.write(unicode(self.uniqueAlt))
if self.conflictingAlts is not None:
buf.write(u",conflictingAlts=")
buf.write(unicode(self.conflictingAlts))
if self.dipsIntoOuterContext:
buf.write(u",dipsIntoOuterContext")
return buf.getvalue()
class OrderedATNConfigSet(ATNConfigSet):
def __init__(self):
super(OrderedATNConfigSet, self).__init__()
# self.configLookup = set()
| {
"content_hash": "d3165a5c4286c004991ace6569fd4ec2",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 112,
"avg_line_length": 38.20792079207921,
"alnum_prop": 0.6335838300077741,
"repo_name": "cooperra/antlr4",
"id": "9bfae3b199c056484b7bc0de4d82d371ebe42100",
"size": "9461",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "runtime/Python2/src/antlr4/atn/ATNConfigSet.py",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "ANTLR",
"bytes": "72606"
},
{
"name": "Batchfile",
"bytes": "139"
},
{
"name": "C#",
"bytes": "1460309"
},
{
"name": "GAP",
"bytes": "110837"
},
{
"name": "Java",
"bytes": "5768297"
},
{
"name": "JavaScript",
"bytes": "443990"
},
{
"name": "PowerShell",
"bytes": "6138"
},
{
"name": "Python",
"bytes": "1005486"
}
],
"symlink_target": ""
} |
package jp.co.acroquest.endosnipe.perfdoctor.rule;
import jp.co.acroquest.endosnipe.javelin.JavelinLogUtil;
import jp.co.acroquest.endosnipe.javelin.parser.JavelinLogElement;
/**
* SQLの実行時にargsから引数[TIME]を閾値として取り出す。
* @author eriguchi
*/
public class SQLThresholdStrategy implements ThresholdStrategy
{
/** SQL実行時間の開始タグ */
private static final String TIME_TAG = "[Time]";
/**
* avelinLogElementのargsから引数[TIME]を閾値として取り出す。
* @param javelinLogElement 値を取り出すもとのJavelinLogElement
* @return 取り出した結果
*/
public String extractDurationThreshold(final JavelinLogElement javelinLogElement)
{
String threshold = null;
String[] args = JavelinLogUtil.getArgs(javelinLogElement);
for (int index = 0; index < args.length; index++)
{
String content = JavelinLogUtil.getArgContent(args[index], TIME_TAG);
if (content != null)
{
threshold = content;
break;
}
}
return threshold;
}
}
| {
"content_hash": "361561be6fdb4ee0669e33d138889063",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 85,
"avg_line_length": 28.473684210526315,
"alnum_prop": 0.6266173752310537,
"repo_name": "ryokato/ENdoSnipe",
"id": "248f0b8b7096363bb7821b70ff8dc12224a98d97",
"size": "2606",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "ENdoSnipePerfDoctor/src/main/java/jp/co/acroquest/endosnipe/perfdoctor/rule/SQLThresholdStrategy.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "5525"
},
{
"name": "C",
"bytes": "44081"
},
{
"name": "C++",
"bytes": "19064"
},
{
"name": "CSS",
"bytes": "68679"
},
{
"name": "Groff",
"bytes": "1052204"
},
{
"name": "HTML",
"bytes": "45464"
},
{
"name": "IDL",
"bytes": "1634"
},
{
"name": "Java",
"bytes": "8071035"
},
{
"name": "JavaScript",
"bytes": "1794868"
},
{
"name": "Makefile",
"bytes": "320"
},
{
"name": "PowerShell",
"bytes": "1220"
},
{
"name": "Shell",
"bytes": "7462"
}
],
"symlink_target": ""
} |
#define NONAMELESSUNION
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winreg.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/list.h"
#include "ole2.h"
#include "mmdeviceapi.h"
#include "devpkey.h"
#include "dshow.h"
#include "dsound.h"
#include "initguid.h"
#include "endpointvolume.h"
#include "audioclient.h"
#include "audiopolicy.h"
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <libkern/OSAtomic.h>
#include <CoreAudio/CoreAudio.h>
#include <AudioToolbox/AudioQueue.h>
#include <AudioToolbox/AudioFormat.h>
WINE_DEFAULT_DEBUG_CHANNEL(coreaudio);
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
static const REFERENCE_TIME DefaultPeriod = 200000;
static const REFERENCE_TIME MinimumPeriod = 100000;
typedef struct _QueuedBufInfo {
Float64 start_sampletime;
UINT64 start_pos;
UINT32 len_frames;
struct list entry;
} QueuedBufInfo;
typedef struct _AQBuffer {
AudioQueueBufferRef buf;
struct list entry;
BOOL used;
} AQBuffer;
struct ACImpl;
typedef struct ACImpl ACImpl;
typedef struct _AudioSession {
GUID guid;
struct list clients;
IMMDevice *device;
float master_vol;
UINT32 channel_count;
float *channel_vols;
BOOL mute;
CRITICAL_SECTION lock;
struct list entry;
} AudioSession;
typedef struct _AudioSessionWrapper {
IAudioSessionControl2 IAudioSessionControl2_iface;
IChannelAudioVolume IChannelAudioVolume_iface;
ISimpleAudioVolume ISimpleAudioVolume_iface;
LONG ref;
ACImpl *client;
AudioSession *session;
} AudioSessionWrapper;
struct ACImpl {
IAudioClient IAudioClient_iface;
IAudioRenderClient IAudioRenderClient_iface;
IAudioCaptureClient IAudioCaptureClient_iface;
IAudioClock IAudioClock_iface;
IAudioClock2 IAudioClock2_iface;
IAudioStreamVolume IAudioStreamVolume_iface;
LONG ref;
IMMDevice *parent;
IUnknown *pUnkFTMarshal;
WAVEFORMATEX *fmt;
EDataFlow dataflow;
DWORD flags;
AUDCLNT_SHAREMODE share;
HANDLE event;
float *vols;
AudioDeviceID adevid;
AudioQueueRef aqueue;
AudioObjectPropertyScope scope;
HANDLE timer;
UINT32 period_ms, bufsize_frames, inbuf_frames, read_offs_bytes, period_frames;
UINT64 last_time, written_frames;
AudioQueueBufferRef public_buffer;
UINT32 getbuf_last;
int playing;
BYTE *tmp_buffer, *capture_buf;
Float64 highest_sampletime, next_sampletime;
AudioSession *session;
AudioSessionWrapper *session_wrapper;
struct list entry;
struct list avail_buffers;
struct list queued_buffers; /* either in avail, queued or public_buffer */
struct list queued_bufinfos;
OSSpinLock lock;
};
enum PlayingStates {
StateStopped = 0,
StatePlaying,
StateInTransition
};
static const IAudioClientVtbl AudioClient_Vtbl;
static const IAudioRenderClientVtbl AudioRenderClient_Vtbl;
static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl;
static const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl;
static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl;
static const IAudioClockVtbl AudioClock_Vtbl;
static const IAudioClock2Vtbl AudioClock2_Vtbl;
static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl;
static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl;
static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl;
typedef struct _SessionMgr {
IAudioSessionManager2 IAudioSessionManager2_iface;
LONG ref;
IMMDevice *device;
} SessionMgr;
static const WCHAR drv_keyW[] = {'S','o','f','t','w','a','r','e','\\',
'W','i','n','e','\\','D','r','i','v','e','r','s','\\',
'w','i','n','e','c','o','r','e','a','u','d','i','o','.','d','r','v',0};
static const WCHAR drv_key_devicesW[] = {'S','o','f','t','w','a','r','e','\\',
'W','i','n','e','\\','D','r','i','v','e','r','s','\\',
'w','i','n','e','c','o','r','e','a','u','d','i','o','.','d','r','v','\\','d','e','v','i','c','e','s',0};
static const WCHAR guidW[] = {'g','u','i','d',0};
static HANDLE g_timer_q;
static CRITICAL_SECTION g_sessions_lock;
static CRITICAL_SECTION_DEBUG g_sessions_lock_debug =
{
0, 0, &g_sessions_lock,
{ &g_sessions_lock_debug.ProcessLocksList, &g_sessions_lock_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": g_sessions_lock") }
};
static CRITICAL_SECTION g_sessions_lock = { &g_sessions_lock_debug, -1, 0, 0, 0, 0 };
static struct list g_sessions = LIST_INIT(g_sessions);
static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client);
static HRESULT ca_setvol(ACImpl *This, UINT32 index);
static inline ACImpl *impl_from_IAudioClient(IAudioClient *iface)
{
return CONTAINING_RECORD(iface, ACImpl, IAudioClient_iface);
}
static inline ACImpl *impl_from_IAudioRenderClient(IAudioRenderClient *iface)
{
return CONTAINING_RECORD(iface, ACImpl, IAudioRenderClient_iface);
}
static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface)
{
return CONTAINING_RECORD(iface, ACImpl, IAudioCaptureClient_iface);
}
static inline AudioSessionWrapper *impl_from_IAudioSessionControl2(IAudioSessionControl2 *iface)
{
return CONTAINING_RECORD(iface, AudioSessionWrapper, IAudioSessionControl2_iface);
}
static inline AudioSessionWrapper *impl_from_ISimpleAudioVolume(ISimpleAudioVolume *iface)
{
return CONTAINING_RECORD(iface, AudioSessionWrapper, ISimpleAudioVolume_iface);
}
static inline AudioSessionWrapper *impl_from_IChannelAudioVolume(IChannelAudioVolume *iface)
{
return CONTAINING_RECORD(iface, AudioSessionWrapper, IChannelAudioVolume_iface);
}
static inline ACImpl *impl_from_IAudioClock(IAudioClock *iface)
{
return CONTAINING_RECORD(iface, ACImpl, IAudioClock_iface);
}
static inline ACImpl *impl_from_IAudioClock2(IAudioClock2 *iface)
{
return CONTAINING_RECORD(iface, ACImpl, IAudioClock2_iface);
}
static inline ACImpl *impl_from_IAudioStreamVolume(IAudioStreamVolume *iface)
{
return CONTAINING_RECORD(iface, ACImpl, IAudioStreamVolume_iface);
}
static inline SessionMgr *impl_from_IAudioSessionManager2(IAudioSessionManager2 *iface)
{
return CONTAINING_RECORD(iface, SessionMgr, IAudioSessionManager2_iface);
}
BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved)
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
g_timer_q = CreateTimerQueue();
if(!g_timer_q)
return FALSE;
break;
case DLL_PROCESS_DETACH:
if (reserved) break;
DeleteCriticalSection(&g_sessions_lock);
break;
}
return TRUE;
}
/* From <dlls/mmdevapi/mmdevapi.h> */
enum DriverPriority {
Priority_Unavailable = 0,
Priority_Low,
Priority_Neutral,
Priority_Preferred
};
int WINAPI AUDDRV_GetPriority(void)
{
return Priority_Neutral;
}
static HRESULT osstatus_to_hresult(OSStatus sc)
{
switch(sc){
case kAudioFormatUnsupportedDataFormatError:
case kAudioFormatUnknownFormatError:
case kAudioDeviceUnsupportedFormatError:
return AUDCLNT_E_UNSUPPORTED_FORMAT;
case kAudioHardwareBadDeviceError:
return AUDCLNT_E_DEVICE_INVALIDATED;
}
return E_FAIL;
}
static void set_device_guid(EDataFlow flow, HKEY drv_key, const WCHAR *key_name,
GUID *guid)
{
HKEY key;
BOOL opened = FALSE;
LONG lr;
if(!drv_key){
lr = RegCreateKeyExW(HKEY_CURRENT_USER, drv_key_devicesW, 0, NULL, 0, KEY_WRITE,
NULL, &drv_key, NULL);
if(lr != ERROR_SUCCESS){
ERR("RegCreateKeyEx(drv_key) failed: %u\n", lr);
return;
}
opened = TRUE;
}
lr = RegCreateKeyExW(drv_key, key_name, 0, NULL, 0, KEY_WRITE,
NULL, &key, NULL);
if(lr != ERROR_SUCCESS){
ERR("RegCreateKeyEx(%s) failed: %u\n", wine_dbgstr_w(key_name), lr);
goto exit;
}
lr = RegSetValueExW(key, guidW, 0, REG_BINARY, (BYTE*)guid,
sizeof(GUID));
if(lr != ERROR_SUCCESS)
ERR("RegSetValueEx(%s\\guid) failed: %u\n", wine_dbgstr_w(key_name), lr);
RegCloseKey(key);
exit:
if(opened)
RegCloseKey(drv_key);
}
static void get_device_guid(EDataFlow flow, AudioDeviceID device, GUID *guid)
{
HKEY key = NULL, dev_key;
DWORD type, size = sizeof(*guid);
WCHAR key_name[256];
static const WCHAR key_fmt[] = {'%','u',0};
if(flow == eCapture)
key_name[0] = '1';
else
key_name[0] = '0';
key_name[1] = ',';
sprintfW(key_name + 2, key_fmt, device);
if(RegOpenKeyExW(HKEY_CURRENT_USER, drv_key_devicesW, 0, KEY_WRITE|KEY_READ, &key) == ERROR_SUCCESS){
if(RegOpenKeyExW(key, key_name, 0, KEY_READ, &dev_key) == ERROR_SUCCESS){
if(RegQueryValueExW(dev_key, guidW, 0, &type,
(BYTE*)guid, &size) == ERROR_SUCCESS){
if(type == REG_BINARY){
RegCloseKey(dev_key);
RegCloseKey(key);
return;
}
ERR("Invalid type for device %s GUID: %u; ignoring and overwriting\n",
wine_dbgstr_w(key_name), type);
}
RegCloseKey(dev_key);
}
}
CoCreateGuid(guid);
set_device_guid(flow, key, key_name, guid);
if(key)
RegCloseKey(key);
}
HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids,
GUID **guids, UINT *num, UINT *def_index)
{
UInt32 devsize, size;
AudioDeviceID *devices;
AudioDeviceID default_id;
AudioObjectPropertyAddress addr;
OSStatus sc;
int i, ndevices;
TRACE("%d %p %p %p\n", flow, ids, num, def_index);
addr.mScope = kAudioObjectPropertyScopeGlobal;
addr.mElement = kAudioObjectPropertyElementMaster;
if(flow == eRender)
addr.mSelector = kAudioHardwarePropertyDefaultOutputDevice;
else if(flow == eCapture)
addr.mSelector = kAudioHardwarePropertyDefaultInputDevice;
else
return E_INVALIDARG;
size = sizeof(default_id);
sc = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr, 0,
NULL, &size, &default_id);
if(sc != noErr){
WARN("Getting _DefaultInputDevice property failed: %lx\n", sc);
default_id = -1;
}
addr.mSelector = kAudioHardwarePropertyDevices;
sc = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &addr, 0,
NULL, &devsize);
if(sc != noErr){
WARN("Getting _Devices property size failed: %lx\n", sc);
return osstatus_to_hresult(sc);
}
devices = HeapAlloc(GetProcessHeap(), 0, devsize);
if(!devices)
return E_OUTOFMEMORY;
sc = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr, 0, NULL,
&devsize, devices);
if(sc != noErr){
WARN("Getting _Devices property failed: %lx\n", sc);
HeapFree(GetProcessHeap(), 0, devices);
return osstatus_to_hresult(sc);
}
ndevices = devsize / sizeof(AudioDeviceID);
*ids = HeapAlloc(GetProcessHeap(), 0, ndevices * sizeof(WCHAR *));
if(!*ids){
HeapFree(GetProcessHeap(), 0, devices);
return E_OUTOFMEMORY;
}
*guids = HeapAlloc(GetProcessHeap(), 0, ndevices * sizeof(GUID));
if(!*guids){
HeapFree(GetProcessHeap(), 0, *ids);
HeapFree(GetProcessHeap(), 0, devices);
return E_OUTOFMEMORY;
}
*num = 0;
*def_index = (UINT)-1;
for(i = 0; i < ndevices; ++i){
AudioBufferList *buffers;
CFStringRef name;
SIZE_T len;
int j;
addr.mSelector = kAudioDevicePropertyStreamConfiguration;
if(flow == eRender)
addr.mScope = kAudioDevicePropertyScopeOutput;
else
addr.mScope = kAudioDevicePropertyScopeInput;
addr.mElement = 0;
sc = AudioObjectGetPropertyDataSize(devices[i], &addr, 0, NULL, &size);
if(sc != noErr){
WARN("Unable to get _StreamConfiguration property size for "
"device %lu: %lx\n", devices[i], sc);
continue;
}
buffers = HeapAlloc(GetProcessHeap(), 0, size);
if(!buffers){
HeapFree(GetProcessHeap(), 0, devices);
for(j = 0; j < *num; ++j)
HeapFree(GetProcessHeap(), 0, (*ids)[j]);
HeapFree(GetProcessHeap(), 0, *guids);
HeapFree(GetProcessHeap(), 0, *ids);
return E_OUTOFMEMORY;
}
sc = AudioObjectGetPropertyData(devices[i], &addr, 0, NULL,
&size, buffers);
if(sc != noErr){
WARN("Unable to get _StreamConfiguration property for "
"device %lu: %lx\n", devices[i], sc);
HeapFree(GetProcessHeap(), 0, buffers);
continue;
}
/* check that there's at least one channel in this device before
* we claim it as usable */
for(j = 0; j < buffers->mNumberBuffers; ++j)
if(buffers->mBuffers[j].mNumberChannels > 0)
break;
if(j >= buffers->mNumberBuffers){
HeapFree(GetProcessHeap(), 0, buffers);
continue;
}
HeapFree(GetProcessHeap(), 0, buffers);
size = sizeof(name);
addr.mSelector = kAudioObjectPropertyName;
sc = AudioObjectGetPropertyData(devices[i], &addr, 0, NULL,
&size, &name);
if(sc != noErr){
WARN("Unable to get _Name property for device %lu: %lx\n",
devices[i], sc);
continue;
}
len = CFStringGetLength(name) + 1;
(*ids)[*num] = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if(!(*ids)[*num]){
CFRelease(name);
HeapFree(GetProcessHeap(), 0, devices);
for(j = 0; j < *num; ++j)
HeapFree(GetProcessHeap(), 0, (*ids)[j]);
HeapFree(GetProcessHeap(), 0, *ids);
HeapFree(GetProcessHeap(), 0, *guids);
return E_OUTOFMEMORY;
}
CFStringGetCharacters(name, CFRangeMake(0, len - 1), (UniChar*)(*ids)[*num]);
((*ids)[*num])[len - 1] = 0;
CFRelease(name);
get_device_guid(flow, devices[i], &(*guids)[*num]);
if(*def_index == (UINT)-1 && devices[i] == default_id)
*def_index = *num;
TRACE("device %u: id %s key %u%s\n", *num, debugstr_w((*ids)[*num]),
(unsigned int)devices[i], (*def_index == *num) ? " (default)" : "");
(*num)++;
}
if(*def_index == (UINT)-1)
*def_index = 0;
HeapFree(GetProcessHeap(), 0, devices);
return S_OK;
}
static BOOL get_deviceid_by_guid(GUID *guid, AudioDeviceID *id, EDataFlow *flow)
{
HKEY devices_key;
UINT i = 0;
WCHAR key_name[256];
DWORD key_name_size;
if(RegOpenKeyExW(HKEY_CURRENT_USER, drv_key_devicesW, 0, KEY_READ, &devices_key) != ERROR_SUCCESS){
ERR("No devices in registry?\n");
return FALSE;
}
while(1){
HKEY key;
DWORD size, type;
GUID reg_guid;
key_name_size = sizeof(key_name);
if(RegEnumKeyExW(devices_key, i, key_name, &key_name_size, NULL,
NULL, NULL, NULL) != ERROR_SUCCESS)
break;
if(RegOpenKeyExW(devices_key, key_name, 0, KEY_READ, &key) != ERROR_SUCCESS){
WARN("Couldn't open key: %s\n", wine_dbgstr_w(key_name));
continue;
}
size = sizeof(reg_guid);
if(RegQueryValueExW(key, guidW, 0, &type,
(BYTE*)®_guid, &size) == ERROR_SUCCESS){
if(IsEqualGUID(®_guid, guid)){
RegCloseKey(key);
RegCloseKey(devices_key);
TRACE("Found matching device key: %s\n", wine_dbgstr_w(key_name));
if(key_name[0] == '0')
*flow = eRender;
else if(key_name[0] == '1')
*flow = eCapture;
else{
ERR("Unknown device type: %c\n", key_name[0]);
return FALSE;
}
*id = strtoulW(key_name + 2, NULL, 10);
return TRUE;
}
}
RegCloseKey(key);
++i;
}
RegCloseKey(devices_key);
WARN("No matching device in registry for GUID %s\n", debugstr_guid(guid));
return FALSE;
}
HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient **out)
{
ACImpl *This;
AudioDeviceID adevid;
EDataFlow dataflow;
HRESULT hr;
TRACE("%s %p %p\n", debugstr_guid(guid), dev, out);
if(!get_deviceid_by_guid(guid, &adevid, &dataflow))
return AUDCLNT_E_DEVICE_INVALIDATED;
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ACImpl));
if(!This)
return E_OUTOFMEMORY;
This->IAudioClient_iface.lpVtbl = &AudioClient_Vtbl;
This->IAudioRenderClient_iface.lpVtbl = &AudioRenderClient_Vtbl;
This->IAudioCaptureClient_iface.lpVtbl = &AudioCaptureClient_Vtbl;
This->IAudioClock_iface.lpVtbl = &AudioClock_Vtbl;
This->IAudioClock2_iface.lpVtbl = &AudioClock2_Vtbl;
This->IAudioStreamVolume_iface.lpVtbl = &AudioStreamVolume_Vtbl;
This->dataflow = dataflow;
if(dataflow == eRender)
This->scope = kAudioDevicePropertyScopeOutput;
else if(dataflow == eCapture)
This->scope = kAudioDevicePropertyScopeInput;
else{
HeapFree(GetProcessHeap(), 0, This);
return E_INVALIDARG;
}
This->lock = 0;
hr = CoCreateFreeThreadedMarshaler((IUnknown *)&This->IAudioClient_iface,
(IUnknown **)&This->pUnkFTMarshal);
if (FAILED(hr)) {
HeapFree(GetProcessHeap(), 0, This);
return hr;
}
This->parent = dev;
IMMDevice_AddRef(This->parent);
list_init(&This->avail_buffers);
list_init(&This->queued_buffers);
list_init(&This->queued_bufinfos);
This->adevid = adevid;
*out = &This->IAudioClient_iface;
IAudioClient_AddRef(&This->IAudioClient_iface);
return S_OK;
}
/* current position from start of stream */
#define BUFPOS_ABSOLUTE 1
/* current position from start of this buffer */
#define BUFPOS_RELATIVE 2
static UINT64 get_current_aqbuffer_position(ACImpl *This, int mode)
{
struct list *head;
QueuedBufInfo *bufinfo;
UINT64 ret;
head = list_head(&This->queued_bufinfos);
if(!head){
TRACE("No buffers queued\n");
if(mode == BUFPOS_ABSOLUTE)
return This->written_frames;
return 0;
}
bufinfo = LIST_ENTRY(head, QueuedBufInfo, entry);
if(This->playing == StatePlaying){
AudioTimeStamp tstamp;
OSStatus sc;
/* AudioQueueGetCurrentTime() is brain damaged. The returned
* mSampleTime member jumps backwards seemingly at random, so
* we record the highest sampletime and use that during these
* anomalies.
*
* It also behaves poorly when the queue is paused, jumping
* forwards during the pause and backwards again after resuming.
* So we record the sampletime when the queue is paused and use
* that. */
sc = AudioQueueGetCurrentTime(This->aqueue, NULL, &tstamp, NULL);
if(sc != noErr){
if(sc != kAudioQueueErr_InvalidRunState)
WARN("Unable to get current time: %lx\n", sc);
if(mode == BUFPOS_ABSOLUTE)
return This->highest_sampletime;
return 0;
}
if(!(tstamp.mFlags & kAudioTimeStampSampleTimeValid)){
FIXME("SampleTime not valid: %lx\n", tstamp.mFlags);
return 0;
}
if(tstamp.mSampleTime > This->highest_sampletime)
This->highest_sampletime = tstamp.mSampleTime;
}
while(This->highest_sampletime > bufinfo->start_sampletime + bufinfo->len_frames){
This->inbuf_frames -= bufinfo->len_frames;
list_remove(&bufinfo->entry);
HeapFree(GetProcessHeap(), 0, bufinfo);
head = list_head(&This->queued_bufinfos);
if(!head){
TRACE("No buffers queued\n");
if(mode == BUFPOS_ABSOLUTE)
return This->written_frames;
return 0;
}
bufinfo = LIST_ENTRY(head, QueuedBufInfo, entry);
}
if(This->highest_sampletime < bufinfo->start_sampletime)
ret = 0;
else
ret = This->highest_sampletime - bufinfo->start_sampletime;
if(mode == BUFPOS_ABSOLUTE){
ret = This->written_frames - (bufinfo->len_frames - ret);
while((head = list_next(&This->queued_bufinfos, &bufinfo->entry))){
bufinfo = LIST_ENTRY(head, QueuedBufInfo, entry);
ret -= bufinfo->len_frames;
}
}
TRACE("%llu frames (%s)\n", ret,
mode == BUFPOS_ABSOLUTE ? "absolute" : "relative");
return ret;
}
static void avail_update(ACImpl *This)
{
AQBuffer *buf, *next;
OSStatus sc;
if(This->dataflow == eCapture){
DWORD bufsize_bytes = This->bufsize_frames * This->fmt->nBlockAlign;
DWORD inbuf_bytes = This->inbuf_frames * This->fmt->nBlockAlign;
LIST_FOR_EACH_ENTRY_SAFE(buf, next, &This->queued_buffers, AQBuffer, entry){
DWORD buffer_bytes = buf->buf->mAudioDataByteSize, to_copy_bytes;
if(buf->used)
break;
to_copy_bytes = bufsize_bytes - (This->read_offs_bytes + inbuf_bytes) % bufsize_bytes;
if(buffer_bytes <= to_copy_bytes){
memcpy(This->capture_buf + (This->read_offs_bytes + inbuf_bytes) % bufsize_bytes,
buf->buf->mAudioData, buffer_bytes);
}else{
memcpy(This->capture_buf + (This->read_offs_bytes + inbuf_bytes) % bufsize_bytes,
buf->buf->mAudioData, to_copy_bytes);
memcpy(This->capture_buf, ((char *)buf->buf->mAudioData) + to_copy_bytes,
buffer_bytes - to_copy_bytes);
}
if(inbuf_bytes + buffer_bytes > bufsize_bytes){
This->read_offs_bytes += inbuf_bytes + buffer_bytes;
This->read_offs_bytes %= bufsize_bytes;
inbuf_bytes = bufsize_bytes;
}else
inbuf_bytes += buffer_bytes;
buf->used = TRUE;
list_remove(&buf->entry);
list_add_tail(&This->queued_buffers, &buf->entry);
sc = AudioQueueEnqueueBuffer(This->aqueue, buf->buf, 0, NULL);
if(sc != noErr)
WARN("EnqueueBuffer gave: %lx\n", sc);
}
This->inbuf_frames = inbuf_bytes / This->fmt->nBlockAlign;
}else{
LIST_FOR_EACH_ENTRY_SAFE(buf, next, &This->queued_buffers, AQBuffer, entry){
if(buf->used)
break;
list_remove(&buf->entry);
list_add_tail(&This->avail_buffers, &buf->entry);
}
}
}
static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface,
REFIID riid, void **ppv)
{
ACImpl *This = impl_from_IAudioClient(iface);
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IAudioClient))
*ppv = iface;
else if(IsEqualIID(riid, &IID_IMarshal))
return IUnknown_QueryInterface(This->pUnkFTMarshal, riid, ppv);
if(*ppv){
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
WARN("Unknown interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static ULONG WINAPI AudioClient_AddRef(IAudioClient *iface)
{
ACImpl *This = impl_from_IAudioClient(iface);
ULONG ref;
ref = InterlockedIncrement(&This->ref);
TRACE("(%p) Refcount now %u\n", This, ref);
return ref;
}
static ULONG WINAPI AudioClient_Release(IAudioClient *iface)
{
ACImpl *This = impl_from_IAudioClient(iface);
ULONG ref;
ref = InterlockedDecrement(&This->ref);
TRACE("(%p) Refcount now %u\n", This, ref);
if(!ref){
if(This->aqueue){
AQBuffer *buf, *next;
QueuedBufInfo *bufinfo, *bufinfo2;
if(This->public_buffer){
buf = This->public_buffer->mUserData;
list_add_tail(&This->avail_buffers, &buf->entry);
}
IAudioClient_Stop(iface);
AudioQueueStop(This->aqueue, 1);
/* Stopped synchronously, all buffers returned. */
list_move_tail(&This->avail_buffers, &This->queued_buffers);
LIST_FOR_EACH_ENTRY_SAFE(buf, next, &This->avail_buffers, AQBuffer, entry){
AudioQueueFreeBuffer(This->aqueue, buf->buf);
HeapFree(GetProcessHeap(), 0, buf);
}
LIST_FOR_EACH_ENTRY_SAFE(bufinfo, bufinfo2, &This->queued_bufinfos,
QueuedBufInfo, entry)
HeapFree(GetProcessHeap(), 0, bufinfo);
AudioQueueDispose(This->aqueue, 1);
}
if(This->session){
EnterCriticalSection(&g_sessions_lock);
list_remove(&This->entry);
LeaveCriticalSection(&g_sessions_lock);
}
HeapFree(GetProcessHeap(), 0, This->vols);
HeapFree(GetProcessHeap(), 0, This->tmp_buffer);
HeapFree(GetProcessHeap(), 0, This->capture_buf);
CoTaskMemFree(This->fmt);
IMMDevice_Release(This->parent);
IUnknown_Release(This->pUnkFTMarshal);
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
static void dump_fmt(const WAVEFORMATEX *fmt)
{
TRACE("wFormatTag: 0x%x (", fmt->wFormatTag);
switch(fmt->wFormatTag){
case WAVE_FORMAT_PCM:
TRACE("WAVE_FORMAT_PCM");
break;
case WAVE_FORMAT_IEEE_FLOAT:
TRACE("WAVE_FORMAT_IEEE_FLOAT");
break;
case WAVE_FORMAT_EXTENSIBLE:
TRACE("WAVE_FORMAT_EXTENSIBLE");
break;
default:
TRACE("Unknown");
break;
}
TRACE(")\n");
TRACE("nChannels: %u\n", fmt->nChannels);
TRACE("nSamplesPerSec: %u\n", fmt->nSamplesPerSec);
TRACE("nAvgBytesPerSec: %u\n", fmt->nAvgBytesPerSec);
TRACE("nBlockAlign: %u\n", fmt->nBlockAlign);
TRACE("wBitsPerSample: %u\n", fmt->wBitsPerSample);
TRACE("cbSize: %u\n", fmt->cbSize);
if(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE){
WAVEFORMATEXTENSIBLE *fmtex = (void*)fmt;
TRACE("dwChannelMask: %08x\n", fmtex->dwChannelMask);
TRACE("Samples: %04x\n", fmtex->Samples.wReserved);
TRACE("SubFormat: %s\n", wine_dbgstr_guid(&fmtex->SubFormat));
}
}
static DWORD get_channel_mask(unsigned int channels)
{
switch(channels){
case 0:
return 0;
case 1:
return KSAUDIO_SPEAKER_MONO;
case 2:
return KSAUDIO_SPEAKER_STEREO;
case 3:
return KSAUDIO_SPEAKER_STEREO | SPEAKER_LOW_FREQUENCY;
case 4:
return KSAUDIO_SPEAKER_QUAD; /* not _SURROUND */
case 5:
return KSAUDIO_SPEAKER_QUAD | SPEAKER_LOW_FREQUENCY;
case 6:
return KSAUDIO_SPEAKER_5POINT1; /* not 5POINT1_SURROUND */
case 7:
return KSAUDIO_SPEAKER_5POINT1 | SPEAKER_BACK_CENTER;
case 8:
return KSAUDIO_SPEAKER_7POINT1_SURROUND; /* Vista deprecates 7POINT1 */
}
FIXME("Unknown speaker configuration: %u\n", channels);
return 0;
}
static WAVEFORMATEX *clone_format(const WAVEFORMATEX *fmt)
{
WAVEFORMATEX *ret;
size_t size;
if(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE)
size = sizeof(WAVEFORMATEXTENSIBLE);
else
size = sizeof(WAVEFORMATEX);
ret = CoTaskMemAlloc(size);
if(!ret)
return NULL;
memcpy(ret, fmt, size);
ret->cbSize = size - sizeof(WAVEFORMATEX);
return ret;
}
static HRESULT ca_get_audiodesc(AudioStreamBasicDescription *desc,
const WAVEFORMATEX *fmt)
{
const WAVEFORMATEXTENSIBLE *fmtex = (const WAVEFORMATEXTENSIBLE *)fmt;
desc->mFormatFlags = 0;
if(fmt->wFormatTag == WAVE_FORMAT_PCM ||
(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE &&
IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM))){
desc->mFormatID = kAudioFormatLinearPCM;
if(fmt->wBitsPerSample > 8)
desc->mFormatFlags = kAudioFormatFlagIsSignedInteger;
}else if(fmt->wFormatTag == WAVE_FORMAT_IEEE_FLOAT ||
(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE &&
IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT))){
desc->mFormatID = kAudioFormatLinearPCM;
desc->mFormatFlags = kAudioFormatFlagIsFloat;
}else if(fmt->wFormatTag == WAVE_FORMAT_MULAW ||
(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE &&
IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_MULAW))){
desc->mFormatID = kAudioFormatULaw;
}else if(fmt->wFormatTag == WAVE_FORMAT_ALAW ||
(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE &&
IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_ALAW))){
desc->mFormatID = kAudioFormatALaw;
}else
return AUDCLNT_E_UNSUPPORTED_FORMAT;
desc->mSampleRate = fmt->nSamplesPerSec;
desc->mBytesPerPacket = fmt->nBlockAlign;
desc->mFramesPerPacket = 1;
desc->mBytesPerFrame = fmt->nBlockAlign;
desc->mChannelsPerFrame = fmt->nChannels;
desc->mBitsPerChannel = fmt->wBitsPerSample;
desc->mReserved = 0;
return S_OK;
}
/* We can't use debug printing or {Enter,Leave}CriticalSection from
* OSX callback threads. We may use OSSpinLock.
* OSSpinLock is not a recursive lock, so don't call
* synchronized functions while holding the lock. */
static void ca_out_buffer_cb(void *user, AudioQueueRef aqueue,
AudioQueueBufferRef buffer)
{
AQBuffer *buf = buffer->mUserData;
buf->used = FALSE;
}
static void ca_in_buffer_cb(void *user, AudioQueueRef aqueue,
AudioQueueBufferRef buffer, const AudioTimeStamp *start,
UInt32 ndesc, const AudioStreamPacketDescription *descs)
{
AQBuffer *buf = buffer->mUserData;
buf->used = FALSE;
/* let's update inbuf_frames synchronously without OSAddAtomic */
}
static HRESULT ca_setup_aqueue(AudioDeviceID did, EDataFlow flow,
const WAVEFORMATEX *fmt, void *user, AudioQueueRef *aqueue)
{
AudioStreamBasicDescription desc;
AudioObjectPropertyAddress addr;
CFStringRef uid;
OSStatus sc;
HRESULT hr;
UInt32 size;
addr.mScope = kAudioObjectPropertyScopeGlobal;
addr.mElement = 0;
addr.mSelector = kAudioDevicePropertyDeviceUID;
size = sizeof(uid);
sc = AudioObjectGetPropertyData(did, &addr, 0, NULL, &size, &uid);
if(sc != noErr){
WARN("Unable to get _DeviceUID property: %lx\n", sc);
return osstatus_to_hresult(sc);
}
hr = ca_get_audiodesc(&desc, fmt);
if(FAILED(hr)){
CFRelease(uid);
return hr;
}
if(flow == eRender)
sc = AudioQueueNewOutput(&desc, ca_out_buffer_cb, user, NULL, NULL, 0,
aqueue);
else if(flow == eCapture)
sc = AudioQueueNewInput(&desc, ca_in_buffer_cb, user, NULL, NULL, 0,
aqueue);
else{
CFRelease(uid);
return E_UNEXPECTED;
}
if(sc != noErr){
WARN("Unable to create AudioQueue: %lx\n", sc);
CFRelease(uid);
return osstatus_to_hresult(sc);
}
sc = AudioQueueSetProperty(*aqueue, kAudioQueueProperty_CurrentDevice,
&uid, sizeof(uid));
if(sc != noErr){
WARN("Unable to change AQueue device: %lx\n", sc);
CFRelease(uid);
return osstatus_to_hresult(sc);
}
CFRelease(uid);
return S_OK;
}
static void session_init_vols(AudioSession *session, UINT channels)
{
if(session->channel_count < channels){
UINT i;
if(session->channel_vols)
session->channel_vols = HeapReAlloc(GetProcessHeap(), 0,
session->channel_vols, sizeof(float) * channels);
else
session->channel_vols = HeapAlloc(GetProcessHeap(), 0,
sizeof(float) * channels);
if(!session->channel_vols)
return;
for(i = session->channel_count; i < channels; ++i)
session->channel_vols[i] = 1.f;
session->channel_count = channels;
}
}
static AudioSession *create_session(const GUID *guid, IMMDevice *device,
UINT num_channels)
{
AudioSession *ret;
ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(AudioSession));
if(!ret)
return NULL;
memcpy(&ret->guid, guid, sizeof(GUID));
ret->device = device;
list_init(&ret->clients);
list_add_head(&g_sessions, &ret->entry);
InitializeCriticalSection(&ret->lock);
ret->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": AudioSession.lock");
session_init_vols(ret, num_channels);
ret->master_vol = 1.f;
return ret;
}
/* if channels == 0, then this will return or create a session with
* matching dataflow and GUID. otherwise, channels must also match */
static HRESULT get_audio_session(const GUID *sessionguid,
IMMDevice *device, UINT channels, AudioSession **out)
{
AudioSession *session;
if(!sessionguid || IsEqualGUID(sessionguid, &GUID_NULL)){
*out = create_session(&GUID_NULL, device, channels);
if(!*out)
return E_OUTOFMEMORY;
return S_OK;
}
*out = NULL;
LIST_FOR_EACH_ENTRY(session, &g_sessions, AudioSession, entry){
if(session->device == device &&
IsEqualGUID(sessionguid, &session->guid)){
session_init_vols(session, channels);
*out = session;
break;
}
}
if(!*out){
*out = create_session(sessionguid, device, channels);
if(!*out)
return E_OUTOFMEMORY;
}
return S_OK;
}
static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
AUDCLNT_SHAREMODE mode, DWORD flags, REFERENCE_TIME duration,
REFERENCE_TIME period, const WAVEFORMATEX *fmt,
const GUID *sessionguid)
{
ACImpl *This = impl_from_IAudioClient(iface);
HRESULT hr;
OSStatus sc;
int i;
TRACE("(%p)->(%x, %x, %s, %s, %p, %s)\n", This, mode, flags,
wine_dbgstr_longlong(duration), wine_dbgstr_longlong(period), fmt, debugstr_guid(sessionguid));
if(!fmt)
return E_POINTER;
dump_fmt(fmt);
if(mode != AUDCLNT_SHAREMODE_SHARED && mode != AUDCLNT_SHAREMODE_EXCLUSIVE)
return AUDCLNT_E_NOT_INITIALIZED;
if(flags & ~(AUDCLNT_STREAMFLAGS_CROSSPROCESS |
AUDCLNT_STREAMFLAGS_LOOPBACK |
AUDCLNT_STREAMFLAGS_EVENTCALLBACK |
AUDCLNT_STREAMFLAGS_NOPERSIST |
AUDCLNT_STREAMFLAGS_RATEADJUST |
AUDCLNT_SESSIONFLAGS_EXPIREWHENUNOWNED |
AUDCLNT_SESSIONFLAGS_DISPLAY_HIDE |
AUDCLNT_SESSIONFLAGS_DISPLAY_HIDEWHENEXPIRED)){
TRACE("Unknown flags: %08x\n", flags);
return E_INVALIDARG;
}
if(mode == AUDCLNT_SHAREMODE_SHARED){
period = DefaultPeriod;
if( duration < 3 * period)
duration = 3 * period;
}else{
if(fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE){
if(((WAVEFORMATEXTENSIBLE*)fmt)->dwChannelMask == 0 ||
((WAVEFORMATEXTENSIBLE*)fmt)->dwChannelMask & SPEAKER_RESERVED)
return AUDCLNT_E_UNSUPPORTED_FORMAT;
}
if(!period)
period = DefaultPeriod; /* not minimum */
if(period < MinimumPeriod || period > 5000000)
return AUDCLNT_E_INVALID_DEVICE_PERIOD;
if(duration > 20000000) /* the smaller the period, the lower this limit */
return AUDCLNT_E_BUFFER_SIZE_ERROR;
if(flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK){
if(duration != period)
return AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL;
FIXME("EXCLUSIVE mode with EVENTCALLBACK\n");
return AUDCLNT_E_DEVICE_IN_USE;
}else{
if( duration < 8 * period)
duration = 8 * period; /* may grow above 2s */
}
}
OSSpinLockLock(&This->lock);
if(This->aqueue){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_ALREADY_INITIALIZED;
}
hr = ca_setup_aqueue(This->adevid, This->dataflow, fmt, This, &This->aqueue);
if(FAILED(hr)){
OSSpinLockUnlock(&This->lock);
return hr;
}
This->fmt = clone_format(fmt);
if(!This->fmt){
AudioQueueDispose(This->aqueue, 1);
This->aqueue = NULL;
OSSpinLockUnlock(&This->lock);
return E_OUTOFMEMORY;
}
This->period_ms = period / 10000;
This->period_frames = MulDiv(period, This->fmt->nSamplesPerSec, 10000000);
This->bufsize_frames = MulDiv(duration, fmt->nSamplesPerSec, 10000000);
if(This->dataflow == eCapture){
int i, nbuffs = (This->bufsize_frames / This->period_frames) + 1;
This->capture_buf = HeapAlloc(GetProcessHeap(), 0, This->bufsize_frames * This->fmt->nBlockAlign);
for(i = 0; i < nbuffs; ++i){
AQBuffer *buf;
buf = HeapAlloc(GetProcessHeap(), 0, sizeof(AQBuffer));
if(!buf){
HeapFree(GetProcessHeap(), 0, This->capture_buf);
AudioQueueDispose(This->aqueue, 1);
This->aqueue = NULL;
CoTaskMemFree(This->fmt);
This->fmt = NULL;
OSSpinLockUnlock(&This->lock);
return E_OUTOFMEMORY;
}
sc = AudioQueueAllocateBuffer(This->aqueue, This->period_frames * This->fmt->nBlockAlign, &buf->buf);
if(sc != noErr){
HeapFree(GetProcessHeap(), 0, This->capture_buf);
AudioQueueDispose(This->aqueue, 1);
This->aqueue = NULL;
CoTaskMemFree(This->fmt);
This->fmt = NULL;
OSSpinLockUnlock(&This->lock);
WARN("Couldn't allocate buffer: %lx\n", sc);
return osstatus_to_hresult(sc);
}
buf->buf->mUserData = buf;
buf->used = TRUE;
sc = AudioQueueEnqueueBuffer(This->aqueue, buf->buf, 0, NULL);
if(sc != noErr){
ERR("Couldn't enqueue buffer: %lx\n", sc);
break;
}
list_add_tail(&This->queued_buffers, &buf->entry);
}
}
This->vols = HeapAlloc(GetProcessHeap(), 0, fmt->nChannels * sizeof(float));
if(!This->vols){
HeapFree(GetProcessHeap(), 0, This->capture_buf);
AudioQueueDispose(This->aqueue, 1);
This->aqueue = NULL;
CoTaskMemFree(This->fmt);
This->fmt = NULL;
OSSpinLockUnlock(&This->lock);
return E_OUTOFMEMORY;
}
for(i = 0; i < fmt->nChannels; ++i)
This->vols[i] = 1.f;
This->share = mode;
This->flags = flags;
EnterCriticalSection(&g_sessions_lock);
hr = get_audio_session(sessionguid, This->parent, fmt->nChannels,
&This->session);
if(FAILED(hr)){
LeaveCriticalSection(&g_sessions_lock);
AudioQueueDispose(This->aqueue, 1);
This->aqueue = NULL;
CoTaskMemFree(This->fmt);
This->fmt = NULL;
HeapFree(GetProcessHeap(), 0, This->capture_buf);
HeapFree(GetProcessHeap(), 0, This->vols);
This->vols = NULL;
OSSpinLockUnlock(&This->lock);
return E_INVALIDARG;
}
list_add_tail(&This->session->clients, &This->entry);
LeaveCriticalSection(&g_sessions_lock);
ca_setvol(This, -1);
OSSpinLockUnlock(&This->lock);
return S_OK;
}
static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient *iface,
UINT32 *frames)
{
ACImpl *This = impl_from_IAudioClient(iface);
TRACE("(%p)->(%p)\n", This, frames);
if(!frames)
return E_POINTER;
OSSpinLockLock(&This->lock);
if(!This->aqueue){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_NOT_INITIALIZED;
}
*frames = This->bufsize_frames;
OSSpinLockUnlock(&This->lock);
return S_OK;
}
static HRESULT ca_get_max_stream_latency(ACImpl *This, UInt32 *max)
{
AudioObjectPropertyAddress addr;
AudioStreamID *ids;
UInt32 size;
OSStatus sc;
int nstreams, i;
addr.mScope = This->scope;
addr.mElement = 0;
addr.mSelector = kAudioDevicePropertyStreams;
sc = AudioObjectGetPropertyDataSize(This->adevid, &addr, 0, NULL,
&size);
if(sc != noErr){
WARN("Unable to get size for _Streams property: %lx\n", sc);
return osstatus_to_hresult(sc);
}
ids = HeapAlloc(GetProcessHeap(), 0, size);
if(!ids)
return E_OUTOFMEMORY;
sc = AudioObjectGetPropertyData(This->adevid, &addr, 0, NULL, &size, ids);
if(sc != noErr){
WARN("Unable to get _Streams property: %lx\n", sc);
HeapFree(GetProcessHeap(), 0, ids);
return osstatus_to_hresult(sc);
}
nstreams = size / sizeof(AudioStreamID);
*max = 0;
addr.mSelector = kAudioStreamPropertyLatency;
for(i = 0; i < nstreams; ++i){
UInt32 latency;
size = sizeof(latency);
sc = AudioObjectGetPropertyData(ids[i], &addr, 0, NULL,
&size, &latency);
if(sc != noErr){
WARN("Unable to get _Latency property: %lx\n", sc);
continue;
}
if(latency > *max)
*max = latency;
}
HeapFree(GetProcessHeap(), 0, ids);
return S_OK;
}
static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface,
REFERENCE_TIME *out)
{
ACImpl *This = impl_from_IAudioClient(iface);
UInt32 latency, stream_latency, size;
AudioObjectPropertyAddress addr;
OSStatus sc;
HRESULT hr;
TRACE("(%p)->(%p)\n", This, out);
if(!out)
return E_POINTER;
OSSpinLockLock(&This->lock);
if(!This->aqueue){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_NOT_INITIALIZED;
}
addr.mScope = This->scope;
addr.mSelector = kAudioDevicePropertyLatency;
addr.mElement = 0;
size = sizeof(latency);
sc = AudioObjectGetPropertyData(This->adevid, &addr, 0, NULL,
&size, &latency);
if(sc != noErr){
WARN("Couldn't get _Latency property: %lx\n", sc);
OSSpinLockUnlock(&This->lock);
return osstatus_to_hresult(sc);
}
hr = ca_get_max_stream_latency(This, &stream_latency);
if(FAILED(hr)){
OSSpinLockUnlock(&This->lock);
return hr;
}
latency += stream_latency;
/* pretend we process audio in Period chunks, so max latency includes
* the period time */
*out = MulDiv(latency, 10000000, This->fmt->nSamplesPerSec)
+ This->period_ms * 10000;
OSSpinLockUnlock(&This->lock);
return S_OK;
}
static HRESULT AudioClient_GetCurrentPadding_nolock(ACImpl *This,
UINT32 *numpad)
{
if(!This->aqueue)
return AUDCLNT_E_NOT_INITIALIZED;
avail_update(This);
if(This->dataflow == eRender){
UINT64 bufpos;
bufpos = get_current_aqbuffer_position(This, BUFPOS_RELATIVE);
*numpad = This->inbuf_frames - bufpos;
}else{
*numpad = This->inbuf_frames;
if(*numpad < This->period_frames)
*numpad = 0;
}
return S_OK;
}
static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface,
UINT32 *numpad)
{
ACImpl *This = impl_from_IAudioClient(iface);
HRESULT hr;
TRACE("(%p)->(%p)\n", This, numpad);
if(!numpad)
return E_POINTER;
OSSpinLockLock(&This->lock);
hr = AudioClient_GetCurrentPadding_nolock(This, numpad);
OSSpinLockUnlock(&This->lock);
return hr;
}
static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
AUDCLNT_SHAREMODE mode, const WAVEFORMATEX *pwfx,
WAVEFORMATEX **outpwfx)
{
ACImpl *This = impl_from_IAudioClient(iface);
WAVEFORMATEXTENSIBLE *fmtex = (WAVEFORMATEXTENSIBLE*)pwfx;
AudioQueueRef aqueue;
HRESULT hr;
TRACE("(%p)->(%x, %p, %p)\n", This, mode, pwfx, outpwfx);
if(!pwfx || (mode == AUDCLNT_SHAREMODE_SHARED && !outpwfx))
return E_POINTER;
if(mode != AUDCLNT_SHAREMODE_SHARED && mode != AUDCLNT_SHAREMODE_EXCLUSIVE)
return E_INVALIDARG;
if(pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE &&
pwfx->cbSize < sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX))
return E_INVALIDARG;
dump_fmt(pwfx);
if(outpwfx){
*outpwfx = NULL;
if(mode != AUDCLNT_SHAREMODE_SHARED)
outpwfx = NULL;
}
if(pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE){
if(pwfx->nAvgBytesPerSec == 0 ||
pwfx->nBlockAlign == 0 ||
fmtex->Samples.wValidBitsPerSample > pwfx->wBitsPerSample)
return E_INVALIDARG;
if(fmtex->Samples.wValidBitsPerSample < pwfx->wBitsPerSample)
goto unsupported;
if(mode == AUDCLNT_SHAREMODE_EXCLUSIVE){
if(fmtex->dwChannelMask == 0 ||
fmtex->dwChannelMask & SPEAKER_RESERVED)
goto unsupported;
}
}
if(pwfx->nBlockAlign != pwfx->nChannels * pwfx->wBitsPerSample / 8 ||
pwfx->nAvgBytesPerSec != pwfx->nBlockAlign * pwfx->nSamplesPerSec)
goto unsupported;
if(pwfx->nChannels == 0)
return AUDCLNT_E_UNSUPPORTED_FORMAT;
OSSpinLockLock(&This->lock);
hr = ca_setup_aqueue(This->adevid, This->dataflow, pwfx, NULL, &aqueue);
if(SUCCEEDED(hr)){
AudioQueueDispose(aqueue, 1);
OSSpinLockUnlock(&This->lock);
TRACE("returning %08x\n", S_OK);
return S_OK;
}
OSSpinLockUnlock(&This->lock);
if(hr != AUDCLNT_E_UNSUPPORTED_FORMAT){
TRACE("returning %08x\n", hr);
return hr;
}
unsupported:
if(outpwfx){
hr = IAudioClient_GetMixFormat(&This->IAudioClient_iface, outpwfx);
if(FAILED(hr))
return hr;
return S_FALSE;
}
return AUDCLNT_E_UNSUPPORTED_FORMAT;
}
static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
WAVEFORMATEX **pwfx)
{
ACImpl *This = impl_from_IAudioClient(iface);
WAVEFORMATEXTENSIBLE *fmt;
OSStatus sc;
UInt32 size;
Float64 rate;
AudioBufferList *buffers;
AudioObjectPropertyAddress addr;
int i;
TRACE("(%p)->(%p)\n", This, pwfx);
if(!pwfx)
return E_POINTER;
*pwfx = NULL;
fmt = CoTaskMemAlloc(sizeof(WAVEFORMATEXTENSIBLE));
if(!fmt)
return E_OUTOFMEMORY;
fmt->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
addr.mScope = This->scope;
addr.mElement = 0;
addr.mSelector = kAudioDevicePropertyStreamConfiguration;
sc = AudioObjectGetPropertyDataSize(This->adevid, &addr, 0, NULL, &size);
if(sc != noErr){
CoTaskMemFree(fmt);
WARN("Unable to get size for _StreamConfiguration property: %lx\n", sc);
return osstatus_to_hresult(sc);
}
buffers = HeapAlloc(GetProcessHeap(), 0, size);
if(!buffers){
CoTaskMemFree(fmt);
return E_OUTOFMEMORY;
}
sc = AudioObjectGetPropertyData(This->adevid, &addr, 0, NULL,
&size, buffers);
if(sc != noErr){
CoTaskMemFree(fmt);
HeapFree(GetProcessHeap(), 0, buffers);
WARN("Unable to get _StreamConfiguration property: %lx\n", sc);
return osstatus_to_hresult(sc);
}
fmt->Format.nChannels = 0;
for(i = 0; i < buffers->mNumberBuffers; ++i)
fmt->Format.nChannels += buffers->mBuffers[i].mNumberChannels;
HeapFree(GetProcessHeap(), 0, buffers);
fmt->dwChannelMask = get_channel_mask(fmt->Format.nChannels);
addr.mSelector = kAudioDevicePropertyNominalSampleRate;
size = sizeof(Float64);
sc = AudioObjectGetPropertyData(This->adevid, &addr, 0, NULL, &size, &rate);
if(sc != noErr){
CoTaskMemFree(fmt);
WARN("Unable to get _NominalSampleRate property: %lx\n", sc);
return osstatus_to_hresult(sc);
}
fmt->Format.nSamplesPerSec = rate;
fmt->Format.wBitsPerSample = 32;
fmt->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
fmt->Format.nBlockAlign = (fmt->Format.wBitsPerSample *
fmt->Format.nChannels) / 8;
fmt->Format.nAvgBytesPerSec = fmt->Format.nSamplesPerSec *
fmt->Format.nBlockAlign;
fmt->Samples.wValidBitsPerSample = fmt->Format.wBitsPerSample;
fmt->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
*pwfx = (WAVEFORMATEX*)fmt;
dump_fmt(*pwfx);
return S_OK;
}
static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient *iface,
REFERENCE_TIME *defperiod, REFERENCE_TIME *minperiod)
{
ACImpl *This = impl_from_IAudioClient(iface);
TRACE("(%p)->(%p, %p)\n", This, defperiod, minperiod);
if(!defperiod && !minperiod)
return E_POINTER;
if(defperiod)
*defperiod = DefaultPeriod;
if(minperiod)
*minperiod = MinimumPeriod;
return S_OK;
}
void CALLBACK ca_period_cb(void *user, BOOLEAN timer)
{
ACImpl *This = user;
if(This->event)
SetEvent(This->event);
}
static HRESULT WINAPI AudioClient_Start(IAudioClient *iface)
{
ACImpl *This = impl_from_IAudioClient(iface);
OSStatus sc;
TRACE("(%p)\n", This);
OSSpinLockLock(&This->lock);
if(!This->aqueue){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_NOT_INITIALIZED;
}
if(This->playing != StateStopped){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_NOT_STOPPED;
}
if((This->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK) && !This->event){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_EVENTHANDLE_NOT_SET;
}
if(This->event)
if(!CreateTimerQueueTimer(&This->timer, g_timer_q, ca_period_cb,
This, 0, This->period_ms, WT_EXECUTEINTIMERTHREAD)){
This->timer = NULL;
OSSpinLockUnlock(&This->lock);
WARN("Unable to create timer: %u\n", GetLastError());
return E_OUTOFMEMORY;
}
/* enqueue buffers */
avail_update(This);
This->playing = StateInTransition;
sc = AudioQueueStart(This->aqueue, NULL);
if(sc != noErr){
OSSpinLockUnlock(&This->lock);
WARN("Unable to start audio queue: %lx\n", sc);
return osstatus_to_hresult(sc);
}
This->playing = StatePlaying;
OSSpinLockUnlock(&This->lock);
return S_OK;
}
static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
{
ACImpl *This = impl_from_IAudioClient(iface);
AudioTimeStamp tstamp;
OSStatus sc;
HANDLE event = NULL;
BOOL wait = FALSE;
TRACE("(%p)\n", This);
OSSpinLockLock(&This->lock);
if(!This->aqueue){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_NOT_INITIALIZED;
}
if(This->playing == StateStopped){
OSSpinLockUnlock(&This->lock);
return S_FALSE;
}
if(This->playing == StateInTransition){
OSSpinLockUnlock(&This->lock);
return S_OK;
}
if(This->timer){
event = CreateEventW(NULL, TRUE, FALSE, NULL);
wait = !DeleteTimerQueueTimer(g_timer_q, This->timer, event);
This->timer = NULL;
if(wait)
WARN("DeleteTimerQueueTimer error %u\n", GetLastError());
wait = wait && GetLastError() == ERROR_IO_PENDING;
}
This->playing = StateInTransition;
sc = AudioQueueGetCurrentTime(This->aqueue, NULL, &tstamp, NULL);
if(sc == noErr){
if(tstamp.mFlags & kAudioTimeStampSampleTimeValid){
if(tstamp.mSampleTime > This->highest_sampletime)
This->highest_sampletime = tstamp.mSampleTime;
}else
WARN("Returned tstamp mSampleTime not valid: %lx\n", tstamp.mFlags);
}else
WARN("GetCurrentTime failed: %lx\n", sc);
/* Mac OS bug? Our capture callback is no more called past AQStop */
sc = AudioQueuePause(This->aqueue);
if(sc != noErr){
OSSpinLockUnlock(&This->lock);
WARN("Unable to pause audio queue: %lx\n", sc);
return osstatus_to_hresult(sc);
}
This->playing = StateStopped;
OSSpinLockUnlock(&This->lock);
if(event && wait)
WaitForSingleObject(event, INFINITE);
CloseHandle(event);
return S_OK;
}
static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface)
{
ACImpl *This = impl_from_IAudioClient(iface);
OSStatus sc;
QueuedBufInfo *bufinfo, *bufinfo2;
TRACE("(%p)\n", This);
OSSpinLockLock(&This->lock);
if(!This->aqueue){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_NOT_INITIALIZED;
}
if(This->playing != StateStopped){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_NOT_STOPPED;
}
if(This->getbuf_last){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_BUFFER_OPERATION_PENDING;
}
avail_update(This); /* going to skip over inbuf_frames */
LIST_FOR_EACH_ENTRY_SAFE(bufinfo, bufinfo2, &This->queued_bufinfos,
QueuedBufInfo, entry){
list_remove(&bufinfo->entry);
HeapFree(GetProcessHeap(), 0, bufinfo);
}
sc = AudioQueueReset(This->aqueue);
if(sc != noErr){
OSSpinLockUnlock(&This->lock);
WARN("Unable to reset audio queue: %lx\n", sc);
return osstatus_to_hresult(sc);
}
if(This->dataflow == eRender){
This->written_frames = 0;
}else{
This->written_frames += This->inbuf_frames;
}
This->inbuf_frames = 0;
OSSpinLockUnlock(&This->lock);
return S_OK;
}
static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient *iface,
HANDLE event)
{
ACImpl *This = impl_from_IAudioClient(iface);
TRACE("(%p)->(%p)\n", This, event);
if(!event)
return E_INVALIDARG;
OSSpinLockLock(&This->lock);
if(!This->aqueue){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_NOT_INITIALIZED;
}
if(!(This->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK)){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED;
}
if (This->event){
OSSpinLockUnlock(&This->lock);
FIXME("called twice\n");
return HRESULT_FROM_WIN32(ERROR_INVALID_NAME);
}
This->event = event;
OSSpinLockUnlock(&This->lock);
return S_OK;
}
static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid,
void **ppv)
{
ACImpl *This = impl_from_IAudioClient(iface);
TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
OSSpinLockLock(&This->lock);
if(!This->aqueue){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_NOT_INITIALIZED;
}
if(IsEqualIID(riid, &IID_IAudioRenderClient)){
if(This->dataflow != eRender){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_WRONG_ENDPOINT_TYPE;
}
IAudioRenderClient_AddRef(&This->IAudioRenderClient_iface);
*ppv = &This->IAudioRenderClient_iface;
}else if(IsEqualIID(riid, &IID_IAudioCaptureClient)){
if(This->dataflow != eCapture){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_WRONG_ENDPOINT_TYPE;
}
IAudioCaptureClient_AddRef(&This->IAudioCaptureClient_iface);
*ppv = &This->IAudioCaptureClient_iface;
}else if(IsEqualIID(riid, &IID_IAudioClock)){
IAudioClock_AddRef(&This->IAudioClock_iface);
*ppv = &This->IAudioClock_iface;
}else if(IsEqualIID(riid, &IID_IAudioStreamVolume)){
IAudioStreamVolume_AddRef(&This->IAudioStreamVolume_iface);
*ppv = &This->IAudioStreamVolume_iface;
}else if(IsEqualIID(riid, &IID_IAudioSessionControl)){
if(!This->session_wrapper){
This->session_wrapper = AudioSessionWrapper_Create(This);
if(!This->session_wrapper){
OSSpinLockUnlock(&This->lock);
return E_OUTOFMEMORY;
}
}else
IAudioSessionControl2_AddRef(&This->session_wrapper->IAudioSessionControl2_iface);
*ppv = &This->session_wrapper->IAudioSessionControl2_iface;
}else if(IsEqualIID(riid, &IID_IChannelAudioVolume)){
if(!This->session_wrapper){
This->session_wrapper = AudioSessionWrapper_Create(This);
if(!This->session_wrapper){
OSSpinLockUnlock(&This->lock);
return E_OUTOFMEMORY;
}
}else
IChannelAudioVolume_AddRef(&This->session_wrapper->IChannelAudioVolume_iface);
*ppv = &This->session_wrapper->IChannelAudioVolume_iface;
}else if(IsEqualIID(riid, &IID_ISimpleAudioVolume)){
if(!This->session_wrapper){
This->session_wrapper = AudioSessionWrapper_Create(This);
if(!This->session_wrapper){
OSSpinLockUnlock(&This->lock);
return E_OUTOFMEMORY;
}
}else
ISimpleAudioVolume_AddRef(&This->session_wrapper->ISimpleAudioVolume_iface);
*ppv = &This->session_wrapper->ISimpleAudioVolume_iface;
}
if(*ppv){
OSSpinLockUnlock(&This->lock);
return S_OK;
}
OSSpinLockUnlock(&This->lock);
FIXME("stub %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static const IAudioClientVtbl AudioClient_Vtbl =
{
AudioClient_QueryInterface,
AudioClient_AddRef,
AudioClient_Release,
AudioClient_Initialize,
AudioClient_GetBufferSize,
AudioClient_GetStreamLatency,
AudioClient_GetCurrentPadding,
AudioClient_IsFormatSupported,
AudioClient_GetMixFormat,
AudioClient_GetDevicePeriod,
AudioClient_Start,
AudioClient_Stop,
AudioClient_Reset,
AudioClient_SetEventHandle,
AudioClient_GetService
};
static HRESULT WINAPI AudioRenderClient_QueryInterface(
IAudioRenderClient *iface, REFIID riid, void **ppv)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
if(IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IAudioRenderClient))
*ppv = iface;
else if(IsEqualIID(riid, &IID_IMarshal))
return IUnknown_QueryInterface(This->pUnkFTMarshal, riid, ppv);
if(*ppv){
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
WARN("Unknown interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static ULONG WINAPI AudioRenderClient_AddRef(IAudioRenderClient *iface)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
return AudioClient_AddRef(&This->IAudioClient_iface);
}
static ULONG WINAPI AudioRenderClient_Release(IAudioRenderClient *iface)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
return AudioClient_Release(&This->IAudioClient_iface);
}
static void silence_buffer(ACImpl *This, BYTE *buffer, UINT32 frames)
{
WAVEFORMATEXTENSIBLE *fmtex = (WAVEFORMATEXTENSIBLE*)This->fmt;
if((This->fmt->wFormatTag == WAVE_FORMAT_PCM ||
(This->fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE &&
IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM))) &&
This->fmt->wBitsPerSample == 8)
memset(buffer, 128, frames * This->fmt->nBlockAlign);
else
memset(buffer, 0, frames * This->fmt->nBlockAlign);
}
static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface,
UINT32 frames, BYTE **data)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
AQBuffer *buf;
UINT32 pad, bytes;
HRESULT hr;
OSStatus sc;
TRACE("(%p)->(%u, %p)\n", This, frames, data);
if(!data)
return E_POINTER;
*data = NULL;
OSSpinLockLock(&This->lock);
if(This->getbuf_last){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_OUT_OF_ORDER;
}
if(!frames){
OSSpinLockUnlock(&This->lock);
return S_OK;
}
hr = AudioClient_GetCurrentPadding_nolock(This, &pad);
if(FAILED(hr)){
OSSpinLockUnlock(&This->lock);
return hr;
}
if(pad + frames > This->bufsize_frames){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_BUFFER_TOO_LARGE;
}
bytes = frames * This->fmt->nBlockAlign;
LIST_FOR_EACH_ENTRY(buf, &This->avail_buffers, AQBuffer, entry){
if(buf->buf->mAudioDataBytesCapacity >= bytes){
This->public_buffer = buf->buf;
list_remove(&buf->entry);
break;
}
}
if(&buf->entry == &This->avail_buffers){
sc = AudioQueueAllocateBuffer(This->aqueue, bytes,
&This->public_buffer);
if(sc != noErr){
This->public_buffer = NULL;
OSSpinLockUnlock(&This->lock);
WARN("Unable to allocate buffer: %lx\n", sc);
return E_OUTOFMEMORY;
}
buf = HeapAlloc(GetProcessHeap(), 0, sizeof(AQBuffer));
if(!buf){
AudioQueueFreeBuffer(This->aqueue, This->public_buffer);
This->public_buffer = NULL;
OSSpinLockUnlock(&This->lock);
return E_OUTOFMEMORY;
}
buf->used = FALSE;
buf->buf = This->public_buffer;
This->public_buffer->mUserData = buf;
}
This->getbuf_last = frames;
*data = This->public_buffer->mAudioData;
silence_buffer(This, *data, frames);
OSSpinLockUnlock(&This->lock);
return S_OK;
}
static HRESULT WINAPI AudioRenderClient_ReleaseBuffer(
IAudioRenderClient *iface, UINT32 frames, DWORD flags)
{
ACImpl *This = impl_from_IAudioRenderClient(iface);
AQBuffer *buf;
AudioTimeStamp start_time, req_time = {0}, *passed_time = NULL;
OSStatus sc;
TRACE("(%p)->(%u, %x)\n", This, frames, flags);
OSSpinLockLock(&This->lock);
if(!frames){
This->getbuf_last = 0;
if(This->public_buffer){
buf = This->public_buffer->mUserData;
list_add_head(&This->avail_buffers, &buf->entry);
This->public_buffer = NULL;
}
OSSpinLockUnlock(&This->lock);
return S_OK;
}
if(!This->getbuf_last){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_OUT_OF_ORDER;
}
if(frames > This->getbuf_last){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_INVALID_SIZE;
}
if(flags & AUDCLNT_BUFFERFLAGS_SILENT)
silence_buffer(This, This->public_buffer->mAudioData, frames);
This->public_buffer->mAudioDataByteSize = frames * This->fmt->nBlockAlign;
buf = This->public_buffer->mUserData;
buf->used = TRUE;
if(list_empty(&This->queued_bufinfos)){
sc = AudioQueueGetCurrentTime(This->aqueue, NULL, &req_time, NULL);
if(sc == noErr)
passed_time = &req_time;
else
TRACE("AudioQueueGetCurrentTime failed: %lx\n", sc);
}else{
req_time.mSampleTime = This->next_sampletime;
req_time.mFlags = kAudioTimeStampSampleTimeValid;
passed_time = &req_time;
}
sc = AudioQueueEnqueueBufferWithParameters(This->aqueue,
This->public_buffer, 0, NULL, 0, 0, 0, NULL, passed_time,
&start_time);
if(sc != noErr){
OSSpinLockUnlock(&This->lock);
ERR("Unable to enqueue buffer: %lx\n", sc);
return AUDCLNT_E_DEVICE_INVALIDATED;
}
list_add_tail(&This->queued_buffers, &buf->entry);
if(start_time.mFlags & kAudioTimeStampSampleTimeValid){
QueuedBufInfo *bufinfo;
bufinfo = HeapAlloc(GetProcessHeap(), 0, sizeof(*bufinfo));
bufinfo->start_sampletime = start_time.mSampleTime;
bufinfo->start_pos = This->written_frames;
bufinfo->len_frames = frames;
list_add_tail(&This->queued_bufinfos, &bufinfo->entry);
This->next_sampletime = start_time.mSampleTime + bufinfo->len_frames;
}else
WARN("Start time didn't contain valid SampleTime member\n");
if(This->playing == StateStopped)
AudioQueuePrime(This->aqueue, 0, NULL);
This->public_buffer = NULL;
This->getbuf_last = 0;
This->written_frames += frames;
This->inbuf_frames += frames;
OSSpinLockUnlock(&This->lock);
return S_OK;
}
static const IAudioRenderClientVtbl AudioRenderClient_Vtbl = {
AudioRenderClient_QueryInterface,
AudioRenderClient_AddRef,
AudioRenderClient_Release,
AudioRenderClient_GetBuffer,
AudioRenderClient_ReleaseBuffer
};
static HRESULT WINAPI AudioCaptureClient_QueryInterface(
IAudioCaptureClient *iface, REFIID riid, void **ppv)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
if(IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IAudioCaptureClient))
*ppv = iface;
else if(IsEqualIID(riid, &IID_IMarshal))
return IUnknown_QueryInterface(This->pUnkFTMarshal, riid, ppv);
if(*ppv){
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
WARN("Unknown interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static ULONG WINAPI AudioCaptureClient_AddRef(IAudioCaptureClient *iface)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
return IAudioClient_AddRef(&This->IAudioClient_iface);
}
static ULONG WINAPI AudioCaptureClient_Release(IAudioCaptureClient *iface)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
return IAudioClient_Release(&This->IAudioClient_iface);
}
static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface,
BYTE **data, UINT32 *frames, DWORD *flags, UINT64 *devpos,
UINT64 *qpcpos)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
DWORD chunk_bytes;
TRACE("(%p)->(%p, %p, %p, %p, %p)\n", This, data, frames, flags,
devpos, qpcpos);
if(!data || !frames || !flags)
return E_POINTER;
OSSpinLockLock(&This->lock);
if(This->getbuf_last){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_OUT_OF_ORDER;
}
avail_update(This);
if(This->inbuf_frames < This->period_frames){
*frames = 0;
OSSpinLockUnlock(&This->lock);
return AUDCLNT_S_BUFFER_EMPTY;
}
*flags = 0;
chunk_bytes = This->bufsize_frames * This->fmt->nBlockAlign - This->read_offs_bytes;
if(chunk_bytes < This->period_frames * This->fmt->nBlockAlign){
if(!This->tmp_buffer)
This->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, This->period_frames * This->fmt->nBlockAlign);
*data = This->tmp_buffer;
memcpy(*data, This->capture_buf + This->read_offs_bytes, chunk_bytes);
memcpy((*data) + chunk_bytes, This->capture_buf, This->period_frames * This->fmt->nBlockAlign - chunk_bytes);
}else
*data = This->capture_buf + This->read_offs_bytes;
This->getbuf_last = *frames = This->period_frames;
if(devpos)
*devpos = This->written_frames;
if(qpcpos){ /* fixme: qpc of recording time */
LARGE_INTEGER stamp, freq;
QueryPerformanceCounter(&stamp);
QueryPerformanceFrequency(&freq);
*qpcpos = (stamp.QuadPart * (INT64)10000000) / freq.QuadPart;
}
OSSpinLockUnlock(&This->lock);
return S_OK;
}
static HRESULT WINAPI AudioCaptureClient_ReleaseBuffer(
IAudioCaptureClient *iface, UINT32 done)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
TRACE("(%p)->(%u)\n", This, done);
OSSpinLockLock(&This->lock);
if(!done){
This->getbuf_last = 0;
OSSpinLockUnlock(&This->lock);
return S_OK;
}
if(!This->getbuf_last){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_OUT_OF_ORDER;
}
if(This->getbuf_last != done){
OSSpinLockUnlock(&This->lock);
return AUDCLNT_E_INVALID_SIZE;
}
This->written_frames += done;
This->inbuf_frames -= done;
This->read_offs_bytes += done * This->fmt->nBlockAlign;
This->read_offs_bytes %= This->bufsize_frames * This->fmt->nBlockAlign;
This->getbuf_last = 0;
OSSpinLockUnlock(&This->lock);
return S_OK;
}
static HRESULT WINAPI AudioCaptureClient_GetNextPacketSize(
IAudioCaptureClient *iface, UINT32 *frames)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
TRACE("(%p)->(%p)\n", This, frames);
if(!frames)
return E_POINTER;
OSSpinLockLock(&This->lock);
avail_update(This);
if(This->inbuf_frames >= This->period_frames)
*frames = This->period_frames;
else
*frames = 0;
OSSpinLockUnlock(&This->lock);
return S_OK;
}
static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl =
{
AudioCaptureClient_QueryInterface,
AudioCaptureClient_AddRef,
AudioCaptureClient_Release,
AudioCaptureClient_GetBuffer,
AudioCaptureClient_ReleaseBuffer,
AudioCaptureClient_GetNextPacketSize
};
static HRESULT WINAPI AudioClock_QueryInterface(IAudioClock *iface,
REFIID riid, void **ppv)
{
ACImpl *This = impl_from_IAudioClock(iface);
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IAudioClock))
*ppv = iface;
else if(IsEqualIID(riid, &IID_IAudioClock2))
*ppv = &This->IAudioClock2_iface;
if(*ppv){
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
WARN("Unknown interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static ULONG WINAPI AudioClock_AddRef(IAudioClock *iface)
{
ACImpl *This = impl_from_IAudioClock(iface);
return IAudioClient_AddRef(&This->IAudioClient_iface);
}
static ULONG WINAPI AudioClock_Release(IAudioClock *iface)
{
ACImpl *This = impl_from_IAudioClock(iface);
return IAudioClient_Release(&This->IAudioClient_iface);
}
static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq)
{
ACImpl *This = impl_from_IAudioClock(iface);
TRACE("(%p)->(%p)\n", This, freq);
*freq = This->fmt->nSamplesPerSec;
return S_OK;
}
static HRESULT AudioClock_GetPosition_nolock(ACImpl *This,
UINT64 *pos, UINT64 *qpctime)
{
avail_update(This);
if(This->dataflow == eRender)
*pos = get_current_aqbuffer_position(This, BUFPOS_ABSOLUTE);
else
*pos = This->inbuf_frames + This->written_frames;
if(qpctime){
LARGE_INTEGER stamp, freq;
QueryPerformanceCounter(&stamp);
QueryPerformanceFrequency(&freq);
*qpctime = (stamp.QuadPart * (INT64)10000000) / freq.QuadPart;
}
return S_OK;
}
static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos,
UINT64 *qpctime)
{
ACImpl *This = impl_from_IAudioClock(iface);
HRESULT hr;
TRACE("(%p)->(%p, %p)\n", This, pos, qpctime);
if(!pos)
return E_POINTER;
OSSpinLockLock(&This->lock);
hr = AudioClock_GetPosition_nolock(This, pos, qpctime);
OSSpinLockUnlock(&This->lock);
return hr;
}
static HRESULT WINAPI AudioClock_GetCharacteristics(IAudioClock *iface,
DWORD *chars)
{
ACImpl *This = impl_from_IAudioClock(iface);
TRACE("(%p)->(%p)\n", This, chars);
if(!chars)
return E_POINTER;
*chars = AUDIOCLOCK_CHARACTERISTIC_FIXED_FREQ;
return S_OK;
}
static const IAudioClockVtbl AudioClock_Vtbl =
{
AudioClock_QueryInterface,
AudioClock_AddRef,
AudioClock_Release,
AudioClock_GetFrequency,
AudioClock_GetPosition,
AudioClock_GetCharacteristics
};
static HRESULT WINAPI AudioClock2_QueryInterface(IAudioClock2 *iface,
REFIID riid, void **ppv)
{
ACImpl *This = impl_from_IAudioClock2(iface);
return IAudioClock_QueryInterface(&This->IAudioClock_iface, riid, ppv);
}
static ULONG WINAPI AudioClock2_AddRef(IAudioClock2 *iface)
{
ACImpl *This = impl_from_IAudioClock2(iface);
return IAudioClient_AddRef(&This->IAudioClient_iface);
}
static ULONG WINAPI AudioClock2_Release(IAudioClock2 *iface)
{
ACImpl *This = impl_from_IAudioClock2(iface);
return IAudioClient_Release(&This->IAudioClient_iface);
}
static HRESULT WINAPI AudioClock2_GetDevicePosition(IAudioClock2 *iface,
UINT64 *pos, UINT64 *qpctime)
{
ACImpl *This = impl_from_IAudioClock2(iface);
FIXME("(%p)->(%p, %p)\n", This, pos, qpctime);
return E_NOTIMPL;
}
static const IAudioClock2Vtbl AudioClock2_Vtbl =
{
AudioClock2_QueryInterface,
AudioClock2_AddRef,
AudioClock2_Release,
AudioClock2_GetDevicePosition
};
static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)
{
AudioSessionWrapper *ret;
ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(AudioSessionWrapper));
if(!ret)
return NULL;
ret->IAudioSessionControl2_iface.lpVtbl = &AudioSessionControl2_Vtbl;
ret->ISimpleAudioVolume_iface.lpVtbl = &SimpleAudioVolume_Vtbl;
ret->IChannelAudioVolume_iface.lpVtbl = &ChannelAudioVolume_Vtbl;
ret->ref = 1;
ret->client = client;
if(client){
ret->session = client->session;
AudioClient_AddRef(&client->IAudioClient_iface);
}
return ret;
}
static HRESULT WINAPI AudioSessionControl_QueryInterface(
IAudioSessionControl2 *iface, REFIID riid, void **ppv)
{
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
if(IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IAudioSessionControl) ||
IsEqualIID(riid, &IID_IAudioSessionControl2))
*ppv = iface;
if(*ppv){
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
WARN("Unknown interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static ULONG WINAPI AudioSessionControl_AddRef(IAudioSessionControl2 *iface)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
ULONG ref;
ref = InterlockedIncrement(&This->ref);
TRACE("(%p) Refcount now %u\n", This, ref);
return ref;
}
static ULONG WINAPI AudioSessionControl_Release(IAudioSessionControl2 *iface)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
ULONG ref;
ref = InterlockedDecrement(&This->ref);
TRACE("(%p) Refcount now %u\n", This, ref);
if(!ref){
if(This->client){
OSSpinLockLock(&This->client->lock);
This->client->session_wrapper = NULL;
OSSpinLockUnlock(&This->client->lock);
AudioClient_Release(&This->client->IAudioClient_iface);
}
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
static HRESULT WINAPI AudioSessionControl_GetState(IAudioSessionControl2 *iface,
AudioSessionState *state)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
ACImpl *client;
TRACE("(%p)->(%p)\n", This, state);
if(!state)
return NULL_PTR_ERR;
EnterCriticalSection(&g_sessions_lock);
if(list_empty(&This->session->clients)){
*state = AudioSessionStateExpired;
LeaveCriticalSection(&g_sessions_lock);
return S_OK;
}
LIST_FOR_EACH_ENTRY(client, &This->session->clients, ACImpl, entry){
OSSpinLockLock(&client->lock);
if(client->playing == StatePlaying ||
client->playing == StateInTransition){
*state = AudioSessionStateActive;
OSSpinLockUnlock(&client->lock);
LeaveCriticalSection(&g_sessions_lock);
return S_OK;
}
OSSpinLockUnlock(&client->lock);
}
LeaveCriticalSection(&g_sessions_lock);
*state = AudioSessionStateInactive;
return S_OK;
}
static HRESULT WINAPI AudioSessionControl_GetDisplayName(
IAudioSessionControl2 *iface, WCHAR **name)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
FIXME("(%p)->(%p) - stub\n", This, name);
return E_NOTIMPL;
}
static HRESULT WINAPI AudioSessionControl_SetDisplayName(
IAudioSessionControl2 *iface, const WCHAR *name, const GUID *session)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
FIXME("(%p)->(%p, %s) - stub\n", This, name, debugstr_guid(session));
return E_NOTIMPL;
}
static HRESULT WINAPI AudioSessionControl_GetIconPath(
IAudioSessionControl2 *iface, WCHAR **path)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
FIXME("(%p)->(%p) - stub\n", This, path);
return E_NOTIMPL;
}
static HRESULT WINAPI AudioSessionControl_SetIconPath(
IAudioSessionControl2 *iface, const WCHAR *path, const GUID *session)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
FIXME("(%p)->(%p, %s) - stub\n", This, path, debugstr_guid(session));
return E_NOTIMPL;
}
static HRESULT WINAPI AudioSessionControl_GetGroupingParam(
IAudioSessionControl2 *iface, GUID *group)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
FIXME("(%p)->(%p) - stub\n", This, group);
return E_NOTIMPL;
}
static HRESULT WINAPI AudioSessionControl_SetGroupingParam(
IAudioSessionControl2 *iface, const GUID *group, const GUID *session)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
FIXME("(%p)->(%s, %s) - stub\n", This, debugstr_guid(group),
debugstr_guid(session));
return E_NOTIMPL;
}
static HRESULT WINAPI AudioSessionControl_RegisterAudioSessionNotification(
IAudioSessionControl2 *iface, IAudioSessionEvents *events)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
FIXME("(%p)->(%p) - stub\n", This, events);
return S_OK;
}
static HRESULT WINAPI AudioSessionControl_UnregisterAudioSessionNotification(
IAudioSessionControl2 *iface, IAudioSessionEvents *events)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
FIXME("(%p)->(%p) - stub\n", This, events);
return S_OK;
}
static HRESULT WINAPI AudioSessionControl_GetSessionIdentifier(
IAudioSessionControl2 *iface, WCHAR **id)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
FIXME("(%p)->(%p) - stub\n", This, id);
return E_NOTIMPL;
}
static HRESULT WINAPI AudioSessionControl_GetSessionInstanceIdentifier(
IAudioSessionControl2 *iface, WCHAR **id)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
FIXME("(%p)->(%p) - stub\n", This, id);
return E_NOTIMPL;
}
static HRESULT WINAPI AudioSessionControl_GetProcessId(
IAudioSessionControl2 *iface, DWORD *pid)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
TRACE("(%p)->(%p)\n", This, pid);
if(!pid)
return E_POINTER;
*pid = GetCurrentProcessId();
return S_OK;
}
static HRESULT WINAPI AudioSessionControl_IsSystemSoundsSession(
IAudioSessionControl2 *iface)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
TRACE("(%p)\n", This);
return S_FALSE;
}
static HRESULT WINAPI AudioSessionControl_SetDuckingPreference(
IAudioSessionControl2 *iface, BOOL optout)
{
AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface);
TRACE("(%p)->(%d)\n", This, optout);
return S_OK;
}
static const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl =
{
AudioSessionControl_QueryInterface,
AudioSessionControl_AddRef,
AudioSessionControl_Release,
AudioSessionControl_GetState,
AudioSessionControl_GetDisplayName,
AudioSessionControl_SetDisplayName,
AudioSessionControl_GetIconPath,
AudioSessionControl_SetIconPath,
AudioSessionControl_GetGroupingParam,
AudioSessionControl_SetGroupingParam,
AudioSessionControl_RegisterAudioSessionNotification,
AudioSessionControl_UnregisterAudioSessionNotification,
AudioSessionControl_GetSessionIdentifier,
AudioSessionControl_GetSessionInstanceIdentifier,
AudioSessionControl_GetProcessId,
AudioSessionControl_IsSystemSoundsSession,
AudioSessionControl_SetDuckingPreference
};
/* index == -1 means set all channels, otherwise sets only the given channel */
static HRESULT ca_setvol(ACImpl *This, UINT32 index)
{
float level;
OSStatus sc;
if(index == (UINT32)-1){
HRESULT ret = S_OK;
UINT32 i;
for(i = 0; i < This->fmt->nChannels; ++i){
HRESULT hr;
hr = ca_setvol(This, i);
if(FAILED(hr))
ret = hr;
}
return ret;
}
if(This->session->mute)
level = 0;
else
level = This->session->master_vol *
This->session->channel_vols[index] * This->vols[index];
sc = AudioQueueSetParameter(This->aqueue, kAudioQueueParam_Volume, level);
if(sc != noErr)
WARN("Setting _Volume property failed: %lx\n", sc);
return S_OK;
}
static HRESULT ca_session_setvol(AudioSession *session, UINT32 index)
{
HRESULT ret = S_OK;
ACImpl *client;
LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry){
HRESULT hr;
hr = ca_setvol(client, index);
if(FAILED(hr))
ret = hr;
}
return ret;
}
static HRESULT WINAPI SimpleAudioVolume_QueryInterface(
ISimpleAudioVolume *iface, REFIID riid, void **ppv)
{
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
if(IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_ISimpleAudioVolume))
*ppv = iface;
if(*ppv){
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
WARN("Unknown interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static ULONG WINAPI SimpleAudioVolume_AddRef(ISimpleAudioVolume *iface)
{
AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface);
return AudioSessionControl_AddRef(&This->IAudioSessionControl2_iface);
}
static ULONG WINAPI SimpleAudioVolume_Release(ISimpleAudioVolume *iface)
{
AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface);
return AudioSessionControl_Release(&This->IAudioSessionControl2_iface);
}
static HRESULT WINAPI SimpleAudioVolume_SetMasterVolume(
ISimpleAudioVolume *iface, float level, const GUID *context)
{
AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface);
AudioSession *session = This->session;
HRESULT ret;
TRACE("(%p)->(%f, %s)\n", session, level, wine_dbgstr_guid(context));
if(level < 0.f || level > 1.f)
return E_INVALIDARG;
if(context)
FIXME("Notifications not supported yet\n");
EnterCriticalSection(&session->lock);
session->master_vol = level;
ret = ca_session_setvol(session, -1);
LeaveCriticalSection(&session->lock);
return ret;
}
static HRESULT WINAPI SimpleAudioVolume_GetMasterVolume(
ISimpleAudioVolume *iface, float *level)
{
AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface);
AudioSession *session = This->session;
TRACE("(%p)->(%p)\n", session, level);
if(!level)
return NULL_PTR_ERR;
*level = session->master_vol;
return S_OK;
}
static HRESULT WINAPI SimpleAudioVolume_SetMute(ISimpleAudioVolume *iface,
BOOL mute, const GUID *context)
{
AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface);
AudioSession *session = This->session;
TRACE("(%p)->(%u, %p)\n", session, mute, context);
if(context)
FIXME("Notifications not supported yet\n");
EnterCriticalSection(&session->lock);
session->mute = mute;
ca_session_setvol(session, -1);
LeaveCriticalSection(&session->lock);
return S_OK;
}
static HRESULT WINAPI SimpleAudioVolume_GetMute(ISimpleAudioVolume *iface,
BOOL *mute)
{
AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface);
AudioSession *session = This->session;
TRACE("(%p)->(%p)\n", session, mute);
if(!mute)
return NULL_PTR_ERR;
*mute = session->mute;
return S_OK;
}
static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl =
{
SimpleAudioVolume_QueryInterface,
SimpleAudioVolume_AddRef,
SimpleAudioVolume_Release,
SimpleAudioVolume_SetMasterVolume,
SimpleAudioVolume_GetMasterVolume,
SimpleAudioVolume_SetMute,
SimpleAudioVolume_GetMute
};
static HRESULT WINAPI AudioStreamVolume_QueryInterface(
IAudioStreamVolume *iface, REFIID riid, void **ppv)
{
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
if(IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IAudioStreamVolume))
*ppv = iface;
if(*ppv){
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
WARN("Unknown interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static ULONG WINAPI AudioStreamVolume_AddRef(IAudioStreamVolume *iface)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
return IAudioClient_AddRef(&This->IAudioClient_iface);
}
static ULONG WINAPI AudioStreamVolume_Release(IAudioStreamVolume *iface)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
return IAudioClient_Release(&This->IAudioClient_iface);
}
static HRESULT WINAPI AudioStreamVolume_GetChannelCount(
IAudioStreamVolume *iface, UINT32 *out)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
TRACE("(%p)->(%p)\n", This, out);
if(!out)
return E_POINTER;
*out = This->fmt->nChannels;
return S_OK;
}
static HRESULT WINAPI AudioStreamVolume_SetChannelVolume(
IAudioStreamVolume *iface, UINT32 index, float level)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
HRESULT ret;
TRACE("(%p)->(%d, %f)\n", This, index, level);
if(level < 0.f || level > 1.f)
return E_INVALIDARG;
if(index >= This->fmt->nChannels)
return E_INVALIDARG;
OSSpinLockLock(&This->lock);
This->vols[index] = level;
WARN("AudioQueue doesn't support per-channel volume control\n");
ret = ca_setvol(This, index);
OSSpinLockUnlock(&This->lock);
return ret;
}
static HRESULT WINAPI AudioStreamVolume_GetChannelVolume(
IAudioStreamVolume *iface, UINT32 index, float *level)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
TRACE("(%p)->(%d, %p)\n", This, index, level);
if(!level)
return E_POINTER;
if(index >= This->fmt->nChannels)
return E_INVALIDARG;
*level = This->vols[index];
return S_OK;
}
static HRESULT WINAPI AudioStreamVolume_SetAllVolumes(
IAudioStreamVolume *iface, UINT32 count, const float *levels)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
int i;
HRESULT ret;
TRACE("(%p)->(%d, %p)\n", This, count, levels);
if(!levels)
return E_POINTER;
if(count != This->fmt->nChannels)
return E_INVALIDARG;
OSSpinLockLock(&This->lock);
for(i = 0; i < count; ++i)
This->vols[i] = levels[i];
ret = ca_setvol(This, -1);
OSSpinLockUnlock(&This->lock);
return ret;
}
static HRESULT WINAPI AudioStreamVolume_GetAllVolumes(
IAudioStreamVolume *iface, UINT32 count, float *levels)
{
ACImpl *This = impl_from_IAudioStreamVolume(iface);
int i;
TRACE("(%p)->(%d, %p)\n", This, count, levels);
if(!levels)
return E_POINTER;
if(count != This->fmt->nChannels)
return E_INVALIDARG;
OSSpinLockLock(&This->lock);
for(i = 0; i < count; ++i)
levels[i] = This->vols[i];
OSSpinLockUnlock(&This->lock);
return S_OK;
}
static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl =
{
AudioStreamVolume_QueryInterface,
AudioStreamVolume_AddRef,
AudioStreamVolume_Release,
AudioStreamVolume_GetChannelCount,
AudioStreamVolume_SetChannelVolume,
AudioStreamVolume_GetChannelVolume,
AudioStreamVolume_SetAllVolumes,
AudioStreamVolume_GetAllVolumes
};
static HRESULT WINAPI ChannelAudioVolume_QueryInterface(
IChannelAudioVolume *iface, REFIID riid, void **ppv)
{
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
if(IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IChannelAudioVolume))
*ppv = iface;
if(*ppv){
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
WARN("Unknown interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static ULONG WINAPI ChannelAudioVolume_AddRef(IChannelAudioVolume *iface)
{
AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface);
return AudioSessionControl_AddRef(&This->IAudioSessionControl2_iface);
}
static ULONG WINAPI ChannelAudioVolume_Release(IChannelAudioVolume *iface)
{
AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface);
return AudioSessionControl_Release(&This->IAudioSessionControl2_iface);
}
static HRESULT WINAPI ChannelAudioVolume_GetChannelCount(
IChannelAudioVolume *iface, UINT32 *out)
{
AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface);
AudioSession *session = This->session;
TRACE("(%p)->(%p)\n", session, out);
if(!out)
return NULL_PTR_ERR;
*out = session->channel_count;
return S_OK;
}
static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume(
IChannelAudioVolume *iface, UINT32 index, float level,
const GUID *context)
{
AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface);
AudioSession *session = This->session;
HRESULT ret;
TRACE("(%p)->(%d, %f, %s)\n", session, index, level,
wine_dbgstr_guid(context));
if(level < 0.f || level > 1.f)
return E_INVALIDARG;
if(index >= session->channel_count)
return E_INVALIDARG;
if(context)
FIXME("Notifications not supported yet\n");
EnterCriticalSection(&session->lock);
session->channel_vols[index] = level;
WARN("AudioQueue doesn't support per-channel volume control\n");
ret = ca_session_setvol(session, index);
LeaveCriticalSection(&session->lock);
return ret;
}
static HRESULT WINAPI ChannelAudioVolume_GetChannelVolume(
IChannelAudioVolume *iface, UINT32 index, float *level)
{
AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface);
AudioSession *session = This->session;
TRACE("(%p)->(%d, %p)\n", session, index, level);
if(!level)
return NULL_PTR_ERR;
if(index >= session->channel_count)
return E_INVALIDARG;
*level = session->channel_vols[index];
return S_OK;
}
static HRESULT WINAPI ChannelAudioVolume_SetAllVolumes(
IChannelAudioVolume *iface, UINT32 count, const float *levels,
const GUID *context)
{
AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface);
AudioSession *session = This->session;
int i;
HRESULT ret;
TRACE("(%p)->(%d, %p, %s)\n", session, count, levels,
wine_dbgstr_guid(context));
if(!levels)
return NULL_PTR_ERR;
if(count != session->channel_count)
return E_INVALIDARG;
if(context)
FIXME("Notifications not supported yet\n");
EnterCriticalSection(&session->lock);
for(i = 0; i < count; ++i)
session->channel_vols[i] = levels[i];
ret = ca_session_setvol(session, -1);
LeaveCriticalSection(&session->lock);
return ret;
}
static HRESULT WINAPI ChannelAudioVolume_GetAllVolumes(
IChannelAudioVolume *iface, UINT32 count, float *levels)
{
AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface);
AudioSession *session = This->session;
int i;
TRACE("(%p)->(%d, %p)\n", session, count, levels);
if(!levels)
return NULL_PTR_ERR;
if(count != session->channel_count)
return E_INVALIDARG;
for(i = 0; i < count; ++i)
levels[i] = session->channel_vols[i];
return S_OK;
}
static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl =
{
ChannelAudioVolume_QueryInterface,
ChannelAudioVolume_AddRef,
ChannelAudioVolume_Release,
ChannelAudioVolume_GetChannelCount,
ChannelAudioVolume_SetChannelVolume,
ChannelAudioVolume_GetChannelVolume,
ChannelAudioVolume_SetAllVolumes,
ChannelAudioVolume_GetAllVolumes
};
static HRESULT WINAPI AudioSessionManager_QueryInterface(IAudioSessionManager2 *iface,
REFIID riid, void **ppv)
{
TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv);
if(!ppv)
return E_POINTER;
*ppv = NULL;
if(IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IAudioSessionManager) ||
IsEqualIID(riid, &IID_IAudioSessionManager2))
*ppv = iface;
if(*ppv){
IUnknown_AddRef((IUnknown*)*ppv);
return S_OK;
}
WARN("Unknown interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static ULONG WINAPI AudioSessionManager_AddRef(IAudioSessionManager2 *iface)
{
SessionMgr *This = impl_from_IAudioSessionManager2(iface);
ULONG ref;
ref = InterlockedIncrement(&This->ref);
TRACE("(%p) Refcount now %u\n", This, ref);
return ref;
}
static ULONG WINAPI AudioSessionManager_Release(IAudioSessionManager2 *iface)
{
SessionMgr *This = impl_from_IAudioSessionManager2(iface);
ULONG ref;
ref = InterlockedDecrement(&This->ref);
TRACE("(%p) Refcount now %u\n", This, ref);
if(!ref)
HeapFree(GetProcessHeap(), 0, This);
return ref;
}
static HRESULT WINAPI AudioSessionManager_GetAudioSessionControl(
IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags,
IAudioSessionControl **out)
{
SessionMgr *This = impl_from_IAudioSessionManager2(iface);
AudioSession *session;
AudioSessionWrapper *wrapper;
HRESULT hr;
TRACE("(%p)->(%s, %x, %p)\n", This, debugstr_guid(session_guid),
flags, out);
hr = get_audio_session(session_guid, This->device, 0, &session);
if(FAILED(hr))
return hr;
wrapper = AudioSessionWrapper_Create(NULL);
if(!wrapper)
return E_OUTOFMEMORY;
wrapper->session = session;
*out = (IAudioSessionControl*)&wrapper->IAudioSessionControl2_iface;
return S_OK;
}
static HRESULT WINAPI AudioSessionManager_GetSimpleAudioVolume(
IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags,
ISimpleAudioVolume **out)
{
SessionMgr *This = impl_from_IAudioSessionManager2(iface);
AudioSession *session;
AudioSessionWrapper *wrapper;
HRESULT hr;
TRACE("(%p)->(%s, %x, %p)\n", This, debugstr_guid(session_guid),
flags, out);
hr = get_audio_session(session_guid, This->device, 0, &session);
if(FAILED(hr))
return hr;
wrapper = AudioSessionWrapper_Create(NULL);
if(!wrapper)
return E_OUTOFMEMORY;
wrapper->session = session;
*out = &wrapper->ISimpleAudioVolume_iface;
return S_OK;
}
static HRESULT WINAPI AudioSessionManager_GetSessionEnumerator(
IAudioSessionManager2 *iface, IAudioSessionEnumerator **out)
{
SessionMgr *This = impl_from_IAudioSessionManager2(iface);
FIXME("(%p)->(%p) - stub\n", This, out);
return E_NOTIMPL;
}
static HRESULT WINAPI AudioSessionManager_RegisterSessionNotification(
IAudioSessionManager2 *iface, IAudioSessionNotification *notification)
{
SessionMgr *This = impl_from_IAudioSessionManager2(iface);
FIXME("(%p)->(%p) - stub\n", This, notification);
return E_NOTIMPL;
}
static HRESULT WINAPI AudioSessionManager_UnregisterSessionNotification(
IAudioSessionManager2 *iface, IAudioSessionNotification *notification)
{
SessionMgr *This = impl_from_IAudioSessionManager2(iface);
FIXME("(%p)->(%p) - stub\n", This, notification);
return E_NOTIMPL;
}
static HRESULT WINAPI AudioSessionManager_RegisterDuckNotification(
IAudioSessionManager2 *iface, const WCHAR *session_id,
IAudioVolumeDuckNotification *notification)
{
SessionMgr *This = impl_from_IAudioSessionManager2(iface);
FIXME("(%p)->(%p) - stub\n", This, notification);
return E_NOTIMPL;
}
static HRESULT WINAPI AudioSessionManager_UnregisterDuckNotification(
IAudioSessionManager2 *iface,
IAudioVolumeDuckNotification *notification)
{
SessionMgr *This = impl_from_IAudioSessionManager2(iface);
FIXME("(%p)->(%p) - stub\n", This, notification);
return E_NOTIMPL;
}
static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl =
{
AudioSessionManager_QueryInterface,
AudioSessionManager_AddRef,
AudioSessionManager_Release,
AudioSessionManager_GetAudioSessionControl,
AudioSessionManager_GetSimpleAudioVolume,
AudioSessionManager_GetSessionEnumerator,
AudioSessionManager_RegisterSessionNotification,
AudioSessionManager_UnregisterSessionNotification,
AudioSessionManager_RegisterDuckNotification,
AudioSessionManager_UnregisterDuckNotification
};
HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device,
IAudioSessionManager2 **out)
{
SessionMgr *This;
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SessionMgr));
if(!This)
return E_OUTOFMEMORY;
This->IAudioSessionManager2_iface.lpVtbl = &AudioSessionManager2_Vtbl;
This->device = device;
This->ref = 1;
*out = &This->IAudioSessionManager2_iface;
return S_OK;
}
| {
"content_hash": "c4d203edbe298dfffdbc0e46bd17219d",
"timestamp": "",
"source": "github",
"line_count": 3439,
"max_line_length": 117,
"avg_line_length": 28.519918580982843,
"alnum_prop": 0.6322185970636215,
"repo_name": "howard5888/wine",
"id": "5e3222963541eb04829c52aa7f05de74f6025221",
"size": "98872",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "wine-1.7.7/dlls/winecoreaudio.drv/mmdevdrv.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "3308"
},
{
"name": "C",
"bytes": "118195026"
},
{
"name": "C++",
"bytes": "180964"
},
{
"name": "JavaScript",
"bytes": "300874"
},
{
"name": "Logos",
"bytes": "4941"
},
{
"name": "Objective-C",
"bytes": "247341"
},
{
"name": "Perl",
"bytes": "339801"
},
{
"name": "Ruby",
"bytes": "10503"
},
{
"name": "Shell",
"bytes": "83026"
},
{
"name": "Visual Basic",
"bytes": "53047"
},
{
"name": "XSLT",
"bytes": "544"
}
],
"symlink_target": ""
} |
#include <stdint.h>
#include <sys/param.h>
#include "error/s2n_errno.h"
#include "tls/s2n_cipher_suites.h"
#include "tls/s2n_connection.h"
#include "tls/s2n_record.h"
#include "tls/s2n_crypto.h"
#include "stuffer/s2n_stuffer.h"
#include "crypto/s2n_sequence.h"
#include "crypto/s2n_cipher.h"
#include "crypto/s2n_hmac.h"
#include "utils/s2n_safety.h"
#include "utils/s2n_random.h"
#include "utils/s2n_blob.h"
/* How much overhead does the IV, MAC, TAG and padding bytes introduce ? */
static uint16_t overhead(struct s2n_connection *conn)
{
struct s2n_crypto_parameters *active = conn->server;
if (conn->mode == S2N_CLIENT) {
active = conn->client;
}
uint8_t extra;
GUARD(s2n_hmac_digest_size(active->cipher_suite->record_alg->hmac_alg, &extra));
if (active->cipher_suite->record_alg->cipher->type == S2N_CBC) {
/* Subtract one for the padding length byte */
extra += 1;
if (conn->actual_protocol_version > S2N_TLS10) {
extra += active->cipher_suite->record_alg->cipher->io.cbc.record_iv_size;
}
} else if (active->cipher_suite->record_alg->cipher->type == S2N_AEAD) {
extra += active->cipher_suite->record_alg->cipher->io.aead.tag_size;
extra += active->cipher_suite->record_alg->cipher->io.aead.record_iv_size;
} else if (active->cipher_suite->record_alg->cipher->type == S2N_COMPOSITE && conn->actual_protocol_version > S2N_TLS10) {
extra += active->cipher_suite->record_alg->cipher->io.comp.record_iv_size;
}
return extra;
}
int s2n_record_max_write_payload_size(struct s2n_connection *conn)
{
uint16_t max_fragment_size = conn->max_outgoing_fragment_length;
struct s2n_crypto_parameters *active = conn->server;
if (conn->mode == S2N_CLIENT) {
active = conn->client;
}
/* Round the fragment size down to be block aligned */
if (active->cipher_suite->record_alg->cipher->type == S2N_CBC) {
max_fragment_size -= max_fragment_size % active->cipher_suite->record_alg->cipher->io.cbc.block_size;
} else if (active->cipher_suite->record_alg->cipher->type == S2N_COMPOSITE) {
max_fragment_size -= max_fragment_size % active->cipher_suite->record_alg->cipher->io.comp.block_size;
/* Composite digest length */
max_fragment_size -= active->cipher_suite->record_alg->cipher->io.comp.mac_key_size;
/* Padding length byte */
max_fragment_size -= 1;
}
return max_fragment_size - overhead(conn);
}
int s2n_record_write(struct s2n_connection *conn, uint8_t content_type, struct s2n_blob *in)
{
struct s2n_blob out, iv, aad;
uint8_t padding = 0;
uint16_t block_size = 0;
uint8_t protocol_version[S2N_TLS_PROTOCOL_VERSION_LEN];
uint8_t aad_gen[S2N_TLS_MAX_AAD_LEN] = { 0 };
uint8_t aad_iv[S2N_TLS_MAX_IV_LEN] = { 0 };
uint8_t *sequence_number = conn->server->server_sequence_number;
struct s2n_hmac_state *mac = &conn->server->server_record_mac;
struct s2n_session_key *session_key = &conn->server->server_key;
const struct s2n_cipher_suite *cipher_suite = conn->server->cipher_suite;
uint8_t *implicit_iv = conn->server->server_implicit_iv;
if (conn->mode == S2N_CLIENT) {
sequence_number = conn->client->client_sequence_number;
mac = &conn->client->client_record_mac;
session_key = &conn->client->client_key;
cipher_suite = conn->client->cipher_suite;
implicit_iv = conn->client->client_implicit_iv;
}
if (s2n_stuffer_data_available(&conn->out)) {
S2N_ERROR(S2N_ERR_BAD_MESSAGE);
}
uint8_t mac_digest_size;
GUARD(s2n_hmac_digest_size(mac->alg, &mac_digest_size));
/* Before we do anything, we need to figure out what the length of the
* fragment is going to be.
*/
uint16_t data_bytes_to_take = MIN(in->size, s2n_record_max_write_payload_size(conn));
uint16_t extra = overhead(conn);
/* If we have padding to worry about, figure that out too */
if (cipher_suite->record_alg->cipher->type == S2N_CBC) {
block_size = cipher_suite->record_alg->cipher->io.cbc.block_size;
if (((data_bytes_to_take + extra) % block_size)) {
padding = block_size - ((data_bytes_to_take + extra) % block_size);
}
} else if (cipher_suite->record_alg->cipher->type == S2N_COMPOSITE) {
block_size = cipher_suite->record_alg->cipher->io.comp.block_size;
}
/* Start the MAC with the sequence number */
GUARD(s2n_hmac_update(mac, sequence_number, S2N_TLS_SEQUENCE_NUM_LEN));
/* Now that we know the length, start writing the record */
protocol_version[0] = conn->actual_protocol_version / 10;
protocol_version[1] = conn->actual_protocol_version % 10;
GUARD(s2n_stuffer_write_uint8(&conn->out, content_type));
GUARD(s2n_stuffer_write_bytes(&conn->out, protocol_version, S2N_TLS_PROTOCOL_VERSION_LEN));
/* First write a header that has the payload length, this is for the MAC */
GUARD(s2n_stuffer_write_uint16(&conn->out, data_bytes_to_take));
if (conn->actual_protocol_version > S2N_SSLv3) {
GUARD(s2n_hmac_update(mac, conn->out.blob.data, S2N_TLS_RECORD_HEADER_LENGTH));
} else {
/* SSLv3 doesn't include the protocol version in the MAC */
GUARD(s2n_hmac_update(mac, conn->out.blob.data, 1));
GUARD(s2n_hmac_update(mac, conn->out.blob.data + 3, 2));
}
/* Compute non-payload parts of the MAC(seq num, type, proto vers, fragment length) for composite ciphers.
* Composite "encrypt" will MAC the payload data and fill in padding.
*/
if (cipher_suite->record_alg->cipher->type == S2N_COMPOSITE) {
/* Only fragment length is needed for MAC, but the EVP ctrl function needs fragment length + eiv len. */
uint16_t payload_and_eiv_len = data_bytes_to_take;
if (conn->actual_protocol_version > S2N_TLS10) {
payload_and_eiv_len += block_size;
}
/* Outputs number of extra bytes required for MAC and padding */
int pad_and_mac_len;
GUARD(cipher_suite->record_alg->cipher->io.comp.initial_hmac(session_key, sequence_number, content_type, conn->actual_protocol_version,
payload_and_eiv_len, &pad_and_mac_len));
extra += pad_and_mac_len;
}
/* Rewrite the length to be the actual fragment length */
uint16_t actual_fragment_length = data_bytes_to_take + padding + extra;
GUARD(s2n_stuffer_wipe_n(&conn->out, 2));
GUARD(s2n_stuffer_write_uint16(&conn->out, actual_fragment_length));
/* If we're AEAD, write the sequence number as an IV, and generate the AAD */
if (cipher_suite->record_alg->cipher->type == S2N_AEAD) {
struct s2n_stuffer iv_stuffer;
iv.data = aad_iv;
iv.size = sizeof(aad_iv);
GUARD(s2n_stuffer_init(&iv_stuffer, &iv));
if (cipher_suite->record_alg->flags & S2N_TLS12_AES_GCM_AEAD_NONCE) {
/* Partially explicit nonce. See RFC 5288 Section 3 */
GUARD(s2n_stuffer_write_bytes(&conn->out, sequence_number, S2N_TLS_SEQUENCE_NUM_LEN));
GUARD(s2n_stuffer_write_bytes(&iv_stuffer, implicit_iv, cipher_suite->record_alg->cipher->io.aead.fixed_iv_size));
GUARD(s2n_stuffer_write_bytes(&iv_stuffer, sequence_number, S2N_TLS_SEQUENCE_NUM_LEN));
} else if (cipher_suite->record_alg->flags & S2N_TLS12_CHACHA_POLY_AEAD_NONCE) {
/* Fully implicit nonce. See RFC7905 Section 2 */
uint8_t four_zeroes[4] = { 0 };
GUARD(s2n_stuffer_write_bytes(&iv_stuffer, four_zeroes, 4));
GUARD(s2n_stuffer_write_bytes(&iv_stuffer, sequence_number, S2N_TLS_SEQUENCE_NUM_LEN));
for(int i = 0; i < cipher_suite->record_alg->cipher->io.aead.fixed_iv_size; i++) {
aad_iv[i] = aad_iv[i] ^ implicit_iv[i];
}
} else {
S2N_ERROR(S2N_ERR_INVALID_NONCE_TYPE);
}
/* Set the IV size to the amount of data written */
iv.size = s2n_stuffer_data_available(&iv_stuffer);
aad.data = aad_gen;
aad.size = sizeof(aad_gen);
struct s2n_stuffer ad_stuffer;
GUARD(s2n_stuffer_init(&ad_stuffer, &aad));
GUARD(s2n_aead_aad_init(conn, sequence_number, content_type, data_bytes_to_take, &ad_stuffer));
} else if (cipher_suite->record_alg->cipher->type == S2N_CBC || cipher_suite->record_alg->cipher->type == S2N_COMPOSITE) {
iv.size = block_size;
iv.data = implicit_iv;
/* For TLS1.1/1.2; write the IV with random data */
if (conn->actual_protocol_version > S2N_TLS10) {
GUARD(s2n_get_public_random_data(&iv));
GUARD(s2n_stuffer_write(&conn->out, &iv));
}
}
/* We are done with this sequence number, so we can increment it */
struct s2n_blob seq = {.data = sequence_number,.size = S2N_TLS_SEQUENCE_NUM_LEN };
GUARD(s2n_increment_sequence_number(&seq));
/* Write the plaintext data */
out.data = in->data;
out.size = data_bytes_to_take;
GUARD(s2n_stuffer_write(&conn->out, &out));
GUARD(s2n_hmac_update(mac, out.data, out.size));
/* Write the digest */
uint8_t *digest = s2n_stuffer_raw_write(&conn->out, mac_digest_size);
notnull_check(digest);
GUARD(s2n_hmac_digest(mac, digest, mac_digest_size));
GUARD(s2n_hmac_reset(mac));
if (cipher_suite->record_alg->cipher->type == S2N_CBC) {
/* Include padding bytes, each with the value 'p', and
* include an extra padding length byte, also with the value 'p'.
*/
for (int i = 0; i <= padding; i++) {
GUARD(s2n_stuffer_write_uint8(&conn->out, padding));
}
}
/* Rewind to rewrite/encrypt the packet */
GUARD(s2n_stuffer_rewrite(&conn->out));
/* Skip the header */
GUARD(s2n_stuffer_skip_write(&conn->out, S2N_TLS_RECORD_HEADER_LENGTH));
uint16_t encrypted_length = data_bytes_to_take + mac_digest_size;
switch (cipher_suite->record_alg->cipher->type) {
case S2N_AEAD:
GUARD(s2n_stuffer_skip_write(&conn->out, cipher_suite->record_alg->cipher->io.aead.record_iv_size));
encrypted_length += cipher_suite->record_alg->cipher->io.aead.tag_size;
break;
case S2N_CBC:
if (conn->actual_protocol_version > S2N_TLS10) {
/* Leave the IV alone and unencrypted */
GUARD(s2n_stuffer_skip_write(&conn->out, iv.size));
}
/* Encrypt the padding and the padding length byte too */
encrypted_length += padding + 1;
break;
case S2N_COMPOSITE:
/* Composite CBC expects a pointer starting at explicit IV: [Explicit IV | fragment | MAC | padding | padding len ]
* extra will account for the explicit IV len(if applicable), MAC digest len, padding len + padding byte.
*/
encrypted_length += extra;
break;
default:
break;
}
/* Do the encryption */
struct s2n_blob en;
en.size = encrypted_length;
en.data = s2n_stuffer_raw_write(&conn->out, en.size);
notnull_check(en.data);
switch (cipher_suite->record_alg->cipher->type) {
case S2N_STREAM:
GUARD(cipher_suite->record_alg->cipher->io.stream.encrypt(session_key, &en, &en));
break;
case S2N_CBC:
GUARD(cipher_suite->record_alg->cipher->io.cbc.encrypt(session_key, &iv, &en, &en));
/* Copy the last encrypted block to be the next IV */
if (conn->actual_protocol_version < S2N_TLS11) {
gte_check(en.size, block_size);
memcpy_check(implicit_iv, en.data + en.size - block_size, block_size);
}
break;
case S2N_AEAD:
GUARD(cipher_suite->record_alg->cipher->io.aead.encrypt(session_key, &iv, &aad, &en, &en));
break;
case S2N_COMPOSITE:
/* This will: compute mac, append padding, append padding length, and encrypt */
GUARD(cipher_suite->record_alg->cipher->io.comp.encrypt(session_key, &iv, &en, &en));
/* Copy the last encrypted block to be the next IV */
gte_check(en.size, block_size);
memcpy_check(implicit_iv, en.data + en.size - block_size, block_size);
break;
default:
S2N_ERROR(S2N_ERR_CIPHER_TYPE);
break;
}
conn->wire_bytes_out += actual_fragment_length + S2N_TLS_RECORD_HEADER_LENGTH;
return data_bytes_to_take;
}
| {
"content_hash": "29ea1da3e905b40013427391b5851a1c",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 143,
"avg_line_length": 42.009966777408636,
"alnum_prop": 0.61787267694741,
"repo_name": "jldodds/s2n",
"id": "0de5c74b97a68c452b3a7ff252ca916d18332183",
"size": "13224",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tls/s2n_record_write.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1097077"
},
{
"name": "C++",
"bytes": "4339"
},
{
"name": "CMake",
"bytes": "6549"
},
{
"name": "Coq",
"bytes": "29938"
},
{
"name": "Makefile",
"bytes": "27395"
},
{
"name": "Objective-C",
"bytes": "1766"
},
{
"name": "Perl",
"bytes": "1999"
},
{
"name": "Python",
"bytes": "37411"
},
{
"name": "Shell",
"bytes": "49605"
}
],
"symlink_target": ""
} |
int main () {
zmq::context_t context(1);
// Socket to talk to clients
zmq::socket_t publisher (context, ZMQ_PUB);
int sndhwm = 0;
publisher.setsockopt (ZMQ_SNDHWM, &sndhwm, sizeof (sndhwm));
publisher.bind("tcp://*:5561");
// Socket to receive signals
zmq::socket_t syncservice (context, ZMQ_REP);
syncservice.bind("tcp://*:5562");
// Get synchronization from subscribers
int subscribers = 0;
while (subscribers < SUBSCRIBERS_EXPECTED) {
// - wait for synchronization request
s_recv (syncservice);
// - send synchronization reply
s_send (syncservice, "");
subscribers++;
}
// Now broadcast exactly 1M updates followed by END
int update_nbr;
for (update_nbr = 0; update_nbr < 1000000; update_nbr++) {
s_send (publisher, "Rhubarb");
}
s_send (publisher, "END");
sleep (1); // Give 0MQ time to flush output
return 0;
}
| {
"content_hash": "711736cc8652b19db844cb7348826ea9",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 64,
"avg_line_length": 24.025,
"alnum_prop": 0.6014568158168574,
"repo_name": "fifilyu/zguide-examples-cpp-with-cmake",
"id": "cbab60da2bef6dfae22c7baf7fef5f5b1ca544fc",
"size": "1149",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/syncpub.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "642"
},
{
"name": "C++",
"bytes": "125018"
},
{
"name": "CMake",
"bytes": "3760"
}
],
"symlink_target": ""
} |
package org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.property;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import org.apache.commons.lang3.StringUtils;
import org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskType;
import org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskTypes;
import org.kie.workbench.common.stunner.bpmn.definition.property.type.TaskPropertyType;
import org.kie.workbench.common.stunner.core.definition.property.PropertyType;
import org.kie.workbench.common.stunner.core.util.DefinitionUtils;
/**
* The serializer for TaskType in Oryx differs from the Stunner default as in Oryx
* the taskType is set to a String, which in case of service tasks corresponds to the
* work item declared name.
* In order to apply the right value conversions between the Stunner and the Oryx domain,
* this property serializer handles the special case for work items / service tasks.
* NOTE: This will be no longer necessary once moving to the new BPMN un/mashaller implementations.
*/
@ApplicationScoped
public class TaskTypeSerializer implements Bpmn2OryxPropertySerializer<Object> {
private final DefinitionUtils definitionUtils;
private final EnumTypeSerializer enumTypeSerializer;
protected TaskTypeSerializer() {
this(null,
null);
}
@Inject
public TaskTypeSerializer(final DefinitionUtils definitionUtils,
final EnumTypeSerializer enumTypeSerializer) {
this.definitionUtils = definitionUtils;
this.enumTypeSerializer = enumTypeSerializer;
}
@Override
public boolean accepts(final PropertyType type) {
return TaskPropertyType.name.equals(type.getName());
}
@Override
public Object parse(final Object property,
final String value) {
if (null == value) {
return null;
}
final Object parsed = enumTypeSerializer.parse(property, value);
if (null == parsed) {
((TaskType) property).setRawType(value);
return TaskTypes.SERVICE_TASK;
}
return parsed;
}
@Override
public String serialize(final Object property,
final Object value) {
if (TaskTypes.SERVICE_TASK.equals(value)) {
return ((TaskType) property).getRawType();
}
return StringUtils.capitalize(value.toString().toLowerCase());
}
}
| {
"content_hash": "d7655be12cecc2741b3055ed1e8088c4",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 99,
"avg_line_length": 36.8235294117647,
"alnum_prop": 0.7060702875399361,
"repo_name": "jhrcek/kie-wb-common",
"id": "d5567e1e59c55ed8a57eeb1ad078a92196bcd74b",
"size": "3123",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-backend/src/main/java/org/kie/workbench/common/stunner/bpmn/backend/marshall/json/oryx/property/TaskTypeSerializer.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2591"
},
{
"name": "CSS",
"bytes": "115195"
},
{
"name": "Dockerfile",
"bytes": "210"
},
{
"name": "FreeMarker",
"bytes": "36496"
},
{
"name": "GAP",
"bytes": "86275"
},
{
"name": "HTML",
"bytes": "331778"
},
{
"name": "Java",
"bytes": "38263821"
},
{
"name": "JavaScript",
"bytes": "20277"
},
{
"name": "Shell",
"bytes": "905"
},
{
"name": "Visual Basic",
"bytes": "84832"
}
],
"symlink_target": ""
} |
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Supercreature_1 = require("../abstract/Supercreature");
var Superhero = (function (_super) {
__extends(Superhero, _super);
/**
*
*/
function Superhero(name, alignment, hitPoints, damage, power) {
var _this = _super.call(this, name, alignment, hitPoints, damage) || this;
_this.power = power;
return _this;
}
Superhero.prototype.useSuperPower = function (target) {
this.power.activate(this, target);
};
return Superhero;
}(Supercreature_1.Supercreature));
exports.Superhero = Superhero;
//# sourceMappingURL=Superhero.js.map | {
"content_hash": "e67dce5349860cc5f24c8d0dd5a8028f",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 89,
"avg_line_length": 36.208333333333336,
"alnum_prop": 0.616800920598389,
"repo_name": "pavelhristov/SinglePageApplicationsWithAngular2",
"id": "b66684fcf2f12cc06b95be44a6e34c8efe2eb9ac",
"size": "869",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "workshop-typescript/models/Superhero.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "3767"
},
{
"name": "JavaScript",
"bytes": "3823"
},
{
"name": "TypeScript",
"bytes": "23146"
}
],
"symlink_target": ""
} |
using System;
namespace Logos.Git.GitHub
{
/// <summary>
/// Data describing a Git object returned from GitHub API.
/// </summary>
public sealed class GitObject
{
/// <summary>
/// The object type.
/// </summary>
public string Type { get; set; }
/// <summary>
/// The SHA-1 hash for this object.
/// </summary>
public string Sha { get; set; }
/// <summary>
/// The URL to this object.
/// </summary>
public Uri Url { get; set; }
}
}
| {
"content_hash": "5c63b226793e97805052d5c097c54a09",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 59,
"avg_line_length": 18.64,
"alnum_prop": 0.5944206008583691,
"repo_name": "LogosBible/LogosGit",
"id": "85c38a4f37704ae118acd7b92d288b5b81696a68",
"size": "466",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Logos.Git/GitHub/GitObject.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "27266"
}
],
"symlink_target": ""
} |
/*$FreeBSD: soc2013/dpl/head/sys/dev/vxge/include/vxge-queue.h 221210 2011-04-28 14:33:15Z gnn $*/
#ifndef VXGE_QUEUE_H
#define VXGE_QUEUE_H
__EXTERN_BEGIN_DECLS
#define VXGE_QUEUE_BUF_SIZE 0x1000
#define VXGE_DEFAULT_EVENT_MAX_DATA_SIZE 16
/*
* enum vxge_queue_status_e - Enumerates return codes of the vxge_queue
* manipulation APIs.
* @VXGE_QUEUE_IS_FULL: Queue is full, need to grow.
* @VXGE_QUEUE_IS_EMPTY: Queue is empty.
* @VXGE_QUEUE_OUT_OF_MEMORY: Out of memory.
* @VXGE_QUEUE_NOT_ENOUGH_SPACE: Exceeded specified event size,
* see vxge_queue_consume().
* @VXGE_QUEUE_OK: Neither one of the codes listed above.
*
* Enumerates return codes of vxge_queue_consume()
* and vxge_queue_produce() APIs.
*/
typedef enum vxge_queue_status_e {
VXGE_QUEUE_OK = 0,
VXGE_QUEUE_IS_FULL = 1,
VXGE_QUEUE_IS_EMPTY = 2,
VXGE_QUEUE_OUT_OF_MEMORY = 3,
VXGE_QUEUE_NOT_ENOUGH_SPACE = 4
} vxge_queue_status_e;
typedef void *vxge_queue_h;
/*
* struct vxge_queue_item_t - Queue item.
* @item: List item. Note that the queue is "built" on top of
* the bi-directional linked list.
* @event_type: Event type. Includes (but is not restricted to)
* one of the vxge_hal_event_e {} enumerated types.
* @data_size: Size of the enqueued user data. Note that vxge_queue_t
* items are allowed to have variable sizes.
* @is_critical: For critical events, e.g. ECC.
* @context: Opaque (void *) "context", for instance event producer object.
*
* Item of the vxge_queue_t {}. The queue is protected
* in terms of multi-threaded concurrent access.
* See also: vxge_queue_t {}.
*/
typedef struct vxge_queue_item_t {
vxge_list_t item;
vxge_hal_event_e event_type;
u32 data_size;
u32 is_critical;
void *context;
} vxge_queue_item_t;
/*
* function vxge_queued_f - Item-enqueued callback.
* @data: Per-queue context independent of the event. E.g., device handle.
* @event_type: HAL or ULD-defined event type. Note that HAL own
* events are enumerated by vxge_hal_event_e {}.
*
* Per-queue optional callback. If not NULL, called by HAL each
* time an event gets added to the queue.
*/
typedef void (*vxge_queued_f) (void *data, u32 event_type);
/*
* struct vxge_queue_t - Protected dynamic queue of variable-size items.
* @start_ptr: Points to the start of the queue.
* @end_ptr: Points to the end of the queue.
* @head_ptr: Points to the head of the queue. It gets changed during queue
* produce/consume operations.
* @tail_ptr: Points to the tail of the queue. It gets changed during queue
* produce/consume operations.
* @lock: Lock for queue operations(syncronization purpose).
* @pages_initial:Number of pages to be initially allocated at the time
* of queue creation.
* @pages_max: Max number of pages that can be allocated in the queue.
* @pages_current: Number of pages currently allocated
* @list_head: Points to the list of queue elements that are produced, but yet
* to be consumed.
* @hldev: HAL device handle
* @pdev: PCI device handle
* @irqh: PCI device IRQ handle.
* @queued_func: Optional callback function to be called each time a new
* item is added to the queue.
* @queued_data: Arguments to the callback function.
* @has_critical_event: Non-zero, if the queue contains a critical event,
* see vxge_hal_event_e {}.
* Protected dynamically growing queue. The queue is used to support multiple
* producer/consumer type scenarios. The queue is a strict FIFO: first come
* first served.
* Queue users may "produce" (see vxge_queue_produce()) and "consume"
* (see vxge_queue_consume()) items (a.k.a. events) variable sizes.
* See also: vxge_queue_item_t {}.
*/
typedef struct vxge_queue_t {
void *start_ptr;
void *end_ptr;
void *head_ptr;
void *tail_ptr;
spinlock_t lock;
u32 pages_initial;
u32 pages_max;
u32 pages_current;
vxge_list_t list_head;
vxge_hal_device_h hldev;
pci_dev_h pdev;
pci_irq_h irqh;
vxge_queued_f queued_func;
void *queued_data;
u32 has_critical_event;
} vxge_queue_t;
/* ========================== PUBLIC API ================================= */
/*
* vxge_queue_create - Create protected first-in-first-out queue.
* @devh: HAL device handle.
* @pages_initial: Number of pages to be initially allocated at the
* time of queue creation.
* @pages_max: Max number of pages that can be allocated in the queue.
* @queued_func: Optional callback function to be called each time a new item is
* added to the queue.
* @queued_data: Argument to the callback function.
*
* Create protected (fifo) queue.
*
* Returns: Pointer to vxge_queue_t structure,
* NULL - on failure.
*
* See also: vxge_queue_item_t {}, vxge_queue_destroy().
*/
vxge_queue_h
vxge_queue_create(vxge_hal_device_h devh,
u32 pages_initial,
u32 pages_max,
vxge_queued_f queued_func,
void *queued_data);
/*
* vxge_queue_destroy - Destroy vxge_queue_t object.
* @queueh: Queue handle.
*
* Destroy the specified vxge_queue_t object.
*
* See also: vxge_queue_item_t {}, vxge_queue_create().
*/
void
vxge_queue_destroy(vxge_queue_h queueh);
/*
* vxge_queue_item_data - Get item's data.
* @item: Queue item.
*
* Returns: item data(variable size). Note that vxge_queue_t
* contains items comprized of a fixed vxge_queue_item_t "header"
* and a variable size data. This function returns the variable
* user-defined portion of the queue item.
*/
void *
vxge_queue_item_data(vxge_queue_item_t *item);
/*
* vxge_queue_produce - Enqueue an item (see vxge_queue_item_t {})
* into the specified queue.
* @queueh: Queue handle.
* @event_type: Event type. One of the enumerated event types
* that both consumer and producer "understand".
* For an example, please refer to vxge_hal_event_e.
* @context: Opaque (void *) "context", for instance event producer object.
* @is_critical: For critical event, e.g. ECC.
* @data_size: Size of the @data.
* @data: User data of variable @data_size that is _copied_ into
* the new queue item (see vxge_queue_item_t {}). Upon return
* from the call the @data memory can be re-used or released.
*
* Enqueue a new item.
*
* Returns: VXGE_QUEUE_OK - success.
* VXGE_QUEUE_IS_FULL - Queue is full.
* VXGE_QUEUE_OUT_OF_MEMORY - Memory allocation failed.
*
* See also: vxge_queue_item_t {}, vxge_queue_consume().
*/
vxge_queue_status_e
vxge_queue_produce(vxge_queue_h queueh,
u32 event_type,
void *context,
u32 is_critical,
const u32 data_size,
void *data);
/*
* vxge_queue_produce_context - Enqueue context.
* @queueh: Queue handle.
* @event_type: Event type. One of the enumerated event types
* that both consumer and producer "understand".
* For an example, please refer to vxge_hal_event_e.
* @context: Opaque (void *) "context", for instance event producer object.
*
* Enqueue Context.
*
* Returns: VXGE_QUEUE_OK - success.
* VXGE_QUEUE_IS_EMPTY - Queue is empty.
* VXGE_QUEUE_NOT_ENOUGH_SPACE - Requested item size(@data_max_size)
* is too small to accomodate an item from the queue.
*
* See also: vxge_queue_item_t {}, vxge_queue_produce().
*/
static inline vxge_queue_status_e
/* LINTED */
vxge_queue_produce_context(vxge_queue_h queueh,
u32 event_type,
void *context)
{
return (vxge_queue_produce(queueh, event_type, context, 0, 0, 0));
}
/*
* vxge_queue_consume - Dequeue an item from the specified queue.
* @queueh: Queue handle.
* @data_max_size: Maximum expected size of the item.
* @item: Memory area into which the item is _copied_ upon return
* from the function.
*
* Dequeue an item from the queue. The caller is required to provide
* enough space for the item.
*
* Returns: VXGE_QUEUE_OK - success.
* VXGE_QUEUE_IS_EMPTY - Queue is empty.
* VXGE_QUEUE_NOT_ENOUGH_SPACE - Requested item size(@data_max_size)
* is too small to accomodate an item from the queue.
*
* See also: vxge_queue_item_t {}, vxge_queue_produce().
*/
vxge_queue_status_e
vxge_queue_consume(vxge_queue_h queueh,
u32 data_max_size,
vxge_queue_item_t *item);
/*
* vxge_queue_flush - Flush, or empty, the queue.
* @queueh: Queue handle.
*
* Flush the queue, i.e. make it empty by consuming all events
* without invoking the event processing logic (callbacks, etc.)
*/
void
vxge_queue_flush(vxge_queue_h queueh);
/*
* vxge_io_queue_grow - Dynamically increases the size of the queue.
* @queueh: Queue handle.
*
* This function is called in the case of no slot avaialble in the queue
* to accomodate the newly received event.
* Note that queue cannot grow beyond the max size specified for the
* queue.
*
* Returns VXGE_QUEUE_OK: On success.
* VXGE_QUEUE_OUT_OF_MEMORY : No memory is available.
*/
vxge_queue_status_e
vxge_io_queue_grow(vxge_queue_h qh);
/*
* vxge_queue_get_reset_critical - Check for critical events in the queue,
* @queueh: Queue handle.
*
* Check for critical event(s) in the queue, and reset the
* "has-critical-event" flag upon return.
* Returns: 1 - if the queue contains atleast one critical event.
* 0 - If there are no critical events in the queue.
*/
u32
vxge_queue_get_reset_critical(vxge_queue_h queueh);
__EXTERN_END_DECLS
#endif /* VXGE_QUEUE_H */
| {
"content_hash": "39446006346621b195b3116d49329feb",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 98,
"avg_line_length": 32.371024734982335,
"alnum_prop": 0.694247352909071,
"repo_name": "dplbsd/soc2013",
"id": "990ef871e388a919803ac6987915104c77d9720d",
"size": "10763",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "head/sys/dev/vxge/include/vxge-queue.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "AGS Script",
"bytes": "62471"
},
{
"name": "Assembly",
"bytes": "4478661"
},
{
"name": "Awk",
"bytes": "278525"
},
{
"name": "Batchfile",
"bytes": "20417"
},
{
"name": "C",
"bytes": "383420305"
},
{
"name": "C++",
"bytes": "72796771"
},
{
"name": "CSS",
"bytes": "109748"
},
{
"name": "ChucK",
"bytes": "39"
},
{
"name": "D",
"bytes": "3784"
},
{
"name": "DIGITAL Command Language",
"bytes": "10640"
},
{
"name": "DTrace",
"bytes": "2311027"
},
{
"name": "Emacs Lisp",
"bytes": "65902"
},
{
"name": "EmberScript",
"bytes": "286"
},
{
"name": "Forth",
"bytes": "184405"
},
{
"name": "GAP",
"bytes": "72156"
},
{
"name": "Groff",
"bytes": "32248806"
},
{
"name": "HTML",
"bytes": "6749816"
},
{
"name": "IGOR Pro",
"bytes": "6301"
},
{
"name": "Java",
"bytes": "112547"
},
{
"name": "KRL",
"bytes": "4950"
},
{
"name": "Lex",
"bytes": "398817"
},
{
"name": "Limbo",
"bytes": "3583"
},
{
"name": "Logos",
"bytes": "187900"
},
{
"name": "Makefile",
"bytes": "3551839"
},
{
"name": "Mathematica",
"bytes": "9556"
},
{
"name": "Max",
"bytes": "4178"
},
{
"name": "Module Management System",
"bytes": "817"
},
{
"name": "NSIS",
"bytes": "3383"
},
{
"name": "Objective-C",
"bytes": "836351"
},
{
"name": "PHP",
"bytes": "6649"
},
{
"name": "Perl",
"bytes": "5530761"
},
{
"name": "Perl6",
"bytes": "41802"
},
{
"name": "PostScript",
"bytes": "140088"
},
{
"name": "Prolog",
"bytes": "29514"
},
{
"name": "Protocol Buffer",
"bytes": "61933"
},
{
"name": "Python",
"bytes": "299247"
},
{
"name": "R",
"bytes": "764"
},
{
"name": "Rebol",
"bytes": "738"
},
{
"name": "Ruby",
"bytes": "45958"
},
{
"name": "Scilab",
"bytes": "197"
},
{
"name": "Shell",
"bytes": "10501540"
},
{
"name": "SourcePawn",
"bytes": "463194"
},
{
"name": "SuperCollider",
"bytes": "80208"
},
{
"name": "Tcl",
"bytes": "80913"
},
{
"name": "TeX",
"bytes": "719821"
},
{
"name": "VimL",
"bytes": "22201"
},
{
"name": "XS",
"bytes": "25451"
},
{
"name": "XSLT",
"bytes": "31488"
},
{
"name": "Yacc",
"bytes": "1857830"
}
],
"symlink_target": ""
} |
#ifndef ZBE_SDL_DAEMONS_IOPRELOOPSDL_H_
#define ZBE_SDL_DAEMONS_IOPRELOOPSDL_H_
#include <memory>
#include "ZBE/core/daemons/Daemon.h"
#include "ZBE/SDL/system/SDLWindow.h"
#include "ZBE/SDL/events/SDLEventDispatcher.h"
#include "ZBE/core/system/system.h"
namespace zbe {
/** \brief
*/
class ZBEAPI IOPreLoopSDL : public Daemon {
public:
IOPreLoopSDL(const IOPreLoopSDL&) = delete; //!< Avoid copy.
void operator=(const IOPreLoopSDL&) = delete; //!< Avoid copy.
/** \brief Empty constructor.
*/
IOPreLoopSDL() : sdlEventDist(zbe::SDLEventDispatcher::getInstance()) {}
/** \brief Destroys the IOPreLoopSDL
*/
virtual ~IOPreLoopSDL() {}
/** \brief Runs the daemon.
*/
void run();
private:
zbe::SDLEventDispatcher& sdlEventDist;
};
} // namespace zbe
#endif // ZBE_SDL_DAEMONS_IOPRELOOPSDL_H_
| {
"content_hash": "4c1643775264c797c66ee9844fcb1f33",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 78,
"avg_line_length": 21.878048780487806,
"alnum_prop": 0.6432552954292085,
"repo_name": "Degryll/ZBE",
"id": "24fa6640a186de7ff5e47e5575947db12d3573bb",
"size": "1154",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "include/ZBE/SDL/daemons/IOPreLoopSDL.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "6236"
},
{
"name": "C",
"bytes": "15608956"
},
{
"name": "C++",
"bytes": "12050243"
},
{
"name": "CMake",
"bytes": "74460"
},
{
"name": "GLSL",
"bytes": "3803"
},
{
"name": "HTML",
"bytes": "76712"
},
{
"name": "JavaScript",
"bytes": "36020"
},
{
"name": "Lua",
"bytes": "29749"
},
{
"name": "M4",
"bytes": "57052"
},
{
"name": "Makefile",
"bytes": "47531"
},
{
"name": "Objective-C",
"bytes": "74040"
},
{
"name": "Objective-C++",
"bytes": "72636"
},
{
"name": "PHP",
"bytes": "4919"
},
{
"name": "Python",
"bytes": "31557"
},
{
"name": "Ruby",
"bytes": "708"
},
{
"name": "Shell",
"bytes": "17922"
},
{
"name": "Starlark",
"bytes": "372"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>metacoq-safechecker: Not compatible</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.7.1 / metacoq-safechecker - 1.0~alpha+8.9</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
metacoq-safechecker
<small>
1.0~alpha+8.9
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-07-19 16:35:48 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-07-19 16:35:48 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.12 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq 8.7.1 Formal proof management system.
num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.08.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.08.1 Official release 4.08.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://metacoq.github.io/metacoq"
dev-repo: "git+https://github.com/MetaCoq/metacoq.git#coq-8.8"
bug-reports: "https://github.com/MetaCoq/metacoq/issues"
authors: ["Abhishek Anand <[email protected]>"
"Simon Boulier <[email protected]>"
"Cyril Cohen <[email protected]>"
"Yannick Forster <[email protected]>"
"Fabian Kunze <[email protected]>"
"Gregory Malecha <[email protected]>"
"Matthieu Sozeau <[email protected]>"
"Nicolas Tabareau <[email protected]>"
"Théo Winterhalter <[email protected]>"
]
license: "MIT"
build: [
["sh" "./configure.sh"]
[make "-j%{jobs}%" "-C" "safechecker"]
]
install: [
[make "-C" "safechecker" "install"]
]
depends: [
"ocaml" {> "4.02.3"}
"coq" {>= "8.9" & < "8.10~"}
"coq-metacoq-template" {= version}
"coq-metacoq-checker" {= version}
"coq-metacoq-pcuic" {= version}
]
synopsis: "Implementation and verification of safe conversion and typechecking algorithms for Coq"
description: """
MetaCoq is a meta-programming framework for Coq.
The SafeChecker modules provides a correct implementation of
weak-head reduction, conversion and typechecking of Coq definitions and global environments.
"""
url {
src: "https://github.com/MetaCoq/metacoq/archive/1.0-alpha+8.9.tar.gz"
checksum: "sha256=899ef4ee73b1684a0f1d2e37ab9ab0f9b24424f6d8a10a10efd474c0ed93488e"
}</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-metacoq-safechecker.1.0~alpha+8.9 coq.8.7.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1).
The following dependencies couldn't be met:
- coq-metacoq-safechecker -> coq-metacoq-checker >= 1.0~alpha+8.9 -> coq >= 8.9
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-metacoq-safechecker.1.0~alpha+8.9</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "372e405c5b11e75c7fc832bdd5f4de1b",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 157,
"avg_line_length": 43.083333333333336,
"alnum_prop": 0.5598968407479046,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "626411fc2187d852c2f23e8a42de5515ea92c908",
"size": "7758",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.08.1-2.0.5/released/8.7.1/metacoq-safechecker/1.0~alpha+8.9.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.jvm.scala.target_platform import TargetPlatform
from pants.backend.jvm.targets.exportable_jvm_library import ExportableJvmLibrary
from pants.base.address import SyntheticAddress
from pants.base.exceptions import TargetDefinitionException
class ScalaLibrary(ExportableJvmLibrary):
"""A collection of Scala code.
Normally has conceptually-related sources; invoking the ``compile`` goal
on this target compiles scala and generates classes. Invoking the ``bundle``
goal on this target creates a ``.jar``; but that's an unusual thing to do.
Instead, a ``jvm_binary`` might depend on this library; that binary is a
more sensible thing to bundle.
"""
def __init__(self, java_sources=None, **kwargs):
"""
:param java_sources: Java libraries this library has a *circular*
dependency on.
If you don't have the particular problem of circular dependencies
forced by splitting interdependent java and scala into multiple targets,
don't use this at all.
Prefer using ``dependencies`` to express non-circular dependencies.
:type java_sources: target spec or list of target specs
:param resources: An optional list of paths (DEPRECATED) or ``resources``
targets containing resources that belong on this library's classpath.
"""
self._java_sources_specs = self.assert_list(java_sources)
super(ScalaLibrary, self).__init__(**kwargs)
self.add_labels('scala')
@property
def traversable_dependency_specs(self):
for spec in super(ScalaLibrary, self).traversable_dependency_specs:
yield spec
# TODO(John Sirois): Targets should have a config plumbed as part of the implicit
# BuildFileParser injected context and that could be used to allow in general for targets with
# knobs and in particular an explict config arg to the TargetPlatform constructor below.
for library_spec in TargetPlatform().library_specs:
yield library_spec
@property
def traversable_specs(self):
for spec in super(ScalaLibrary, self).traversable_specs:
yield spec
for java_source_spec in self._java_sources_specs:
yield java_source_spec
def get_jar_dependencies(self):
for jar in super(ScalaLibrary, self).get_jar_dependencies():
yield jar
for java_source_target in self.java_sources:
for jar in java_source_target.jar_dependencies:
yield jar
@property
def java_sources(self):
for spec in self._java_sources_specs:
address = SyntheticAddress.parse(spec, relative_to=self.address.spec_path)
target = self._build_graph.get_target(address)
if target is None:
raise TargetDefinitionException(self, 'No such java target: %s' % spec)
yield target
| {
"content_hash": "1e7cabc2481aabbda70c2dc4dc79de16",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 98,
"avg_line_length": 42.4264705882353,
"alnum_prop": 0.7254766031195841,
"repo_name": "tejal29/pants",
"id": "71d7a3deb6854729248808c2dc0889aa2d04ddc5",
"size": "3032",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/python/pants/backend/jvm/targets/scala_library.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "10977"
},
{
"name": "GAP",
"bytes": "4810"
},
{
"name": "HTML",
"bytes": "75563"
},
{
"name": "Java",
"bytes": "47798"
},
{
"name": "JavaScript",
"bytes": "10157"
},
{
"name": "Protocol Buffer",
"bytes": "5348"
},
{
"name": "Python",
"bytes": "2364916"
},
{
"name": "Scala",
"bytes": "5556"
},
{
"name": "Shell",
"bytes": "39930"
},
{
"name": "Thrift",
"bytes": "1841"
},
{
"name": "XML",
"bytes": "8658"
}
],
"symlink_target": ""
} |
var express = require('express'),
app = express(),
_ = require('lodash'),
async = require('async'),
cons = require('consolidate'),
utils = require('./lib/utils'),
iolib = require('./lib/io'),
conf = require('./lib/config_util.js'),
Handlebars = require('handlebars'),
https = require('https'),
fs = require('fs');
var httpsOptions = {
key: fs.readFileSync('/etc/letsencrypt/live/mianshi.tech/privkey.pem'),
cert: fs.readFileSync('/etc/letsencrypt/live/mianshi.tech/cert.pem')
};
var server = require('https').createServer(httpsOptions, app);
var io = require('socket.io').listen(server);
var httpApp = express();
httpApp.get('*', function (req, res) {
res.redirect('https://mianshi.tech' + req.url);
});
httpApp.listen(80);
require('./lib/handlebars_helper')(Handlebars);
app.engine('html', cons.handlebars);
app.configure(function () {
//app.use(express.logger());
app.set('view engine', 'html');
app.set('views', __dirname + '/views');
});
app.configure('development', function () {
app.use(express.static(__dirname + '/public_src', {
maxAge: 365 * 24 * 60 * 60 * 1000,
hidden: true
}));
});
app.configure('production', function () {
app.use(express.static(__dirname + '/public', {
maxAge: 365 * 24 * 60 * 60 * 1000,
hidden: true
}));
});
app.get('/', function (req, res) {
res.render('index', {
title: 'hello'
});
});
app.get('/new', function (req, res) {
var fileName = utils.getRandomString(5, 7);
res.redirect('/' + fileName);
});
app.get('/:fileName', function (req, res) {
var fileName = req.param('fileName');
res.render('edit', {
fileName: fileName
});
});
app.get('/download/:fileName/:revId?', function (req, res) {
var fileName = req.param('fileName'),
revId = req.param('revId');
async.waterfall([
function (cb) {
if (revId == void 0) {
iolib.getCurrentRev(fileName, cb);
} else {
iolib.getRevById(fileName, revId, cb);
}
}
], function (err, rev) {
if (err) {
res.send(err);
} else {
res.setHeader('Content-disposition', 'attachment; filename=' + fileName + '_' + rev.r);
res.setHeader('Content-type', 'application/octet-stream');
res.end(rev.c || '');
}
});
});
app.get('/history/:fileName/:pageNo?/:pageSize?', function (req, res) {
var fileName = req.param('fileName'),
pageNo = parseInt(req.param('pageNo')),
pageSize = parseInt(req.param('pageSize')) || 20;
iolib.getFileRevs(fileName, pageNo, pageSize, function (err, data) {
var curPage = Math.min(data.curPage, data.totalPage),
prevPage = Math.max(curPage - 1, 1),
nextPage = Math.min(curPage + 1, data.totalPage);
prevPage = prevPage == curPage ? null : prevPage;
nextPage = nextPage == curPage ? null : nextPage;
res.render('history', {
fileName: fileName,
revs: _.toArray(data.revs),
totalPage: data.totalPage,
curPage: curPage,
prevPage: prevPage,
nextPage: nextPage
});
});
});
iolib.init(io);
server.listen(conf.server.port, function (err) {
console.log("Business server listening on port %d in %s mode", conf.server.port, app.settings.env);
});
| {
"content_hash": "81b14a406d72fdc6347153c2dc23acda",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 100,
"avg_line_length": 25.830645161290324,
"alnum_prop": 0.614423977521074,
"repo_name": "blacktail/real-edit",
"id": "b45e5034be1ea3f3913cbb38d0fc207d64c43bd8",
"size": "3203",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ABAP",
"bytes": "1924"
},
{
"name": "ActionScript",
"bytes": "2266"
},
{
"name": "Assembly",
"bytes": "1012"
},
{
"name": "AutoHotkey",
"bytes": "1440"
},
{
"name": "Batchfile",
"bytes": "520"
},
{
"name": "C#",
"bytes": "166"
},
{
"name": "C++",
"bytes": "1522"
},
{
"name": "CSS",
"bytes": "16823"
},
{
"name": "Clojure",
"bytes": "1588"
},
{
"name": "CoffeeScript",
"bytes": "806"
},
{
"name": "ColdFusion",
"bytes": "172"
},
{
"name": "Common Lisp",
"bytes": "1264"
},
{
"name": "DTrace",
"bytes": "24648"
},
{
"name": "Dart",
"bytes": "1968"
},
{
"name": "Erlang",
"bytes": "974"
},
{
"name": "Forth",
"bytes": "1958"
},
{
"name": "FreeMarker",
"bytes": "2034"
},
{
"name": "GLSL",
"bytes": "1024"
},
{
"name": "Go",
"bytes": "1282"
},
{
"name": "Groovy",
"bytes": "2160"
},
{
"name": "HTML",
"bytes": "127523"
},
{
"name": "Harbour",
"bytes": "8868"
},
{
"name": "Haskell",
"bytes": "1024"
},
{
"name": "Haxe",
"bytes": "894"
},
{
"name": "Java",
"bytes": "3100"
},
{
"name": "JavaScript",
"bytes": "35543496"
},
{
"name": "Julia",
"bytes": "404"
},
{
"name": "LSL",
"bytes": "4224"
},
{
"name": "Liquid",
"bytes": "3766"
},
{
"name": "LiveScript",
"bytes": "11494"
},
{
"name": "Lua",
"bytes": "1918"
},
{
"name": "Makefile",
"bytes": "9132"
},
{
"name": "OCaml",
"bytes": "1078"
},
{
"name": "Objective-C",
"bytes": "5344"
},
{
"name": "OpenSCAD",
"bytes": "666"
},
{
"name": "PHP",
"bytes": "702"
},
{
"name": "Pascal",
"bytes": "2824"
},
{
"name": "Perl",
"bytes": "1356"
},
{
"name": "PowerShell",
"bytes": "836"
},
{
"name": "Python",
"bytes": "956"
},
{
"name": "R",
"bytes": "4890"
},
{
"name": "Roff",
"bytes": "38624"
},
{
"name": "Ruby",
"bytes": "1062"
},
{
"name": "Rust",
"bytes": "990"
},
{
"name": "Scala",
"bytes": "3082"
},
{
"name": "Scheme",
"bytes": "1118"
},
{
"name": "Shell",
"bytes": "3641"
},
{
"name": "Tcl",
"bytes": "1798"
},
{
"name": "TeX",
"bytes": "2690"
},
{
"name": "TypeScript",
"bytes": "3214"
},
{
"name": "Visual Basic",
"bytes": "1832"
},
{
"name": "XQuery",
"bytes": "228"
}
],
"symlink_target": ""
} |
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
using Google.Apis.Discovery;
using Google.Apis.Logging;
using Google.Apis.Testing;
using Google.Apis.Tools.CodeGen.Decorator;
using Google.Apis.Tools.CodeGen.Decorator.ResourceContainerDecorator;
using Google.Apis.Tools.CodeGen.Decorator.ResourceDecorator;
using Google.Apis.Tools.CodeGen.Decorator.ResourceDecorator.RequestDecorator;
using Google.Apis.Tools.CodeGen.Decorator.ServiceDecorator;
using Google.Apis.Tools.CodeGen.Generator;
using Google.Apis.Util;
namespace Google.Apis.Tools.CodeGen
{
/// <summary>
/// The main entry for generating code to access google services.
/// For a default generation try calling
/// <example>
/// <code>
/// GoogleServiceGenerator.GenerateService("buzz", "v1", "Com.Example.Namespace", "CSharp", "c:\example\");
/// </code>
/// </example>
/// </summary>
public class GoogleServiceGenerator : BaseGenerator
{
/// <summary>
/// Defines the URL used to discover Google APIs
/// {0}: Service name
/// {1}: Version
/// </summary>
public const string GoogleDiscoveryURL = "https://www.googleapis.com/discovery/v1/apis/{0}/{1}/rest";
/// <summary>
/// The nested namespace where data classes are generated.
/// </summary>
private const string DataNamespaceExtension = ".Data";
private static readonly ILogger logger = ApplicationContext.Logger.ForType<GoogleServiceGenerator>();
/// <summary>
/// List of all request class decorators
/// </summary>
public static IList<IRequestDecorator> GetSchemaAwareCommonRequestDecorators(
string schemaNamespace, IService service)
{
var typeProvider = new DefaultObjectTypeProvider(schemaNamespace);
return (new List<IRequestDecorator>
{
new CommonParameterRequestDecorator(service.Parameters),
new ParameterPropertyDecorator(),
}).AsReadOnly();
}
/// <summary>
/// List of all request class decorators
/// </summary>
public static IList<IRequestDecorator> GetSchemaAwareRequestDecorators(
string schemaNamespace, IService service)
{
var typeProvider = new DefaultObjectTypeProvider(schemaNamespace);
return (new List<IRequestDecorator>()
{
new ServiceRequestInheritanceDecorator(typeProvider),
new BodyPropertyDecorator(typeProvider),
new RequestConstructorDecorator(typeProvider) { CreateOptionalConstructor = false },
new ServiceRequestFieldDecorator(),
}).AsReadOnly();
}
/// <summary>
/// List of all upload class decorators
/// </summary>
public static IList<IRequestDecorator> GetSchemaAwareUploadDecorators(
string schemaNamespace, IService service)
{
var typeProvider = new DefaultObjectTypeProvider(schemaNamespace);
return (new List<IRequestDecorator>
{
new ResumableUploadInheritanceDecorator(typeProvider),
new UploadConstructorDecorator(typeProvider),
}).AsReadOnly();
}
/// <summary>
/// List of all schema aware service decorators
/// </summary>
public static readonly IList<IServiceDecorator> SchemaAwareServiceDecorators =
(new List<IServiceDecorator>
{
new StandardServiceFieldServiceDecorator(),
new StandardConstructServiceDecorator(),
new EasyConstructServiceDecorator(),
new VersionInformationServiceDecorator(),
new CreateRequestMethodServiceDecorator(),
new JsonSerializationMethods(),
new ApiKeyServiceDecorator(),
new ScopeEnumDecorator(),
}).AsReadOnly();
/// <summary>
/// List of all resource container decorators
/// </summary>
public static readonly IList<IResourceContainerDecorator> StandardResourceContainerDecorator =
(new List<IResourceContainerDecorator> { new StandardResourcePropertyServiceDecorator() }).AsReadOnly();
private readonly string codeClientNamespace;
private readonly IEnumerable<IResourceContainerDecorator> resourceContainerDecorators;
private readonly IEnumerable<IResourceDecorator> resourceDecorators;
private readonly GoogleSchemaGenerator schemaGenerator;
private readonly IService service;
private readonly IEnumerable<IServiceDecorator> serviceDecorators;
/// <summary>
/// Generates a new instance of the service generator for a specific service
/// </summary>
public GoogleServiceGenerator(IService service,
string clientNamespace,
IEnumerable<IResourceDecorator> resourceDecorators,
IEnumerable<IServiceDecorator> serviceDecorators,
IEnumerable<IResourceContainerDecorator> resourceContainerDecorators,
GoogleSchemaGenerator schemaGenerator)
{
service.ThrowIfNull("service");
clientNamespace.ThrowIfNull("clientNamespace");
resourceDecorators.ThrowIfNull("resourceDecorators");
serviceDecorators.ThrowIfNull("serviceDecorators");
resourceContainerDecorators.ThrowIfNull("resourceContainerDecorators");
codeClientNamespace = clientNamespace;
this.service = service;
// Defensive copy and readonly
this.resourceDecorators = new List<IResourceDecorator>(resourceDecorators).AsReadOnly();
this.serviceDecorators = new List<IServiceDecorator>(serviceDecorators).AsReadOnly();
this.resourceContainerDecorators =
new List<IResourceContainerDecorator>(resourceContainerDecorators).AsReadOnly();
this.schemaGenerator = schemaGenerator;
}
/// <summary>
/// Generates a new service generator for a specific service
/// </summary>
public GoogleServiceGenerator(IService service, string clientNamespace)
: this(
service, clientNamespace, GetSchemaAwareResourceDecorators(DataNamespace(clientNamespace)),
SchemaAwareServiceDecorators, StandardResourceContainerDecorator,
new GoogleSchemaGenerator(GoogleSchemaGenerator.DefaultSchemaDecorators, DataNamespace(clientNamespace))) {}
/// <summary>
/// Returns a list of all schema aware resource decorators
/// </summary>
public static IList<IResourceDecorator> GetSchemaAwareResourceDecorators(string schemaNamespace)
{
var typeProvider = new DefaultObjectTypeProvider(schemaNamespace);
return
(new List<IResourceDecorator>
{
new SubresourceClassDecorator(),
new EnumResourceDecorator(),
new StandardServiceFieldResourceDecorator(),
new StandardResourceNameResourceDecorator(),
new StandardConstructorResourceDecorator(),
new RequestMethodResourceDecorator(typeProvider) { AddOptionalParameters = false },
}).AsReadOnly
();
}
/// <summary>
/// Creates a cached web discovery device
/// </summary>
internal static IDiscoveryService CreateDefaultCachingDiscovery(string serviceUrl)
{
// Set up how discovery works.
string cacheDirectory = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "GoogleApis.Tools.CodeGenCache");
if (Directory.Exists(cacheDirectory) == false)
{
Directory.CreateDirectory(cacheDirectory);
}
var webfetcher = new CachedWebDiscoveryDevice(new Uri(serviceUrl), new DirectoryInfo(cacheDirectory));
return new DiscoveryService(webfetcher);
}
/// <summary>
/// Generates the given service saving to the outputFile in the language passed in.
/// </summary>
public static void GenerateService(string serviceName,
string version,
string clientNamespace,
string language,
string outputFile)
{
// Generate the discovery URL for that service
string url = string.Format(GoogleDiscoveryURL, serviceName, version);
var discovery = CreateDefaultCachingDiscovery(url);
// Build the service based on discovery information.
var service = discovery.GetService(DiscoveryVersion.Version_1_0, new FactoryParameters());
var generator = new GoogleServiceGenerator(service, clientNamespace);
var generatedCode = generator.GenerateCode();
var provider = CodeDomProvider.CreateProvider(language);
using (StreamWriter sw = new StreamWriter(outputFile, false))
{
IndentedTextWriter tw = new IndentedTextWriter(sw, " ");
// Generate source code using the code provider.
provider.GenerateCodeFromCompileUnit(generatedCode, tw, new CodeGeneratorOptions());
// Close the output file.
tw.Close();
}
}
[VisibleForTestOnly]
internal CodeNamespace GenerateSchemaCode()
{
if (schemaGenerator != null)
{
return schemaGenerator.GenerateSchemaClasses(service);
}
return null;
}
[VisibleForTestOnly]
internal CodeNamespace GenerateClientCode()
{
var clientNamespace = CreateNamespace(codeClientNamespace);
AddClientUsings(clientNamespace);
ResourceContainerGenerator resourceContainerGenerator =
new ResourceContainerGenerator(resourceContainerDecorators);
var requestClassGenerator = new RequestClassGenerator(
GetSchemaAwareCommonRequestDecorators(DataNamespace(codeClientNamespace), service),
GetSchemaAwareRequestDecorators(DataNamespace(codeClientNamespace), service),
GetSchemaAwareUploadDecorators(DataNamespace(codeClientNamespace), service));
var serviceClass =
new ServiceClassGenerator(service, serviceDecorators, resourceContainerGenerator).CreateServiceClass();
string serviceClassName = serviceClass.Name;
clientNamespace.Types.Add(serviceClass);
CreateResources(
clientNamespace, serviceClassName, service, requestClassGenerator, resourceContainerGenerator);
return clientNamespace;
}
/// <summary>
/// Generates the code for this service
/// </summary>
public CodeCompileUnit GenerateCode()
{
logger.Debug("Starting Code Generation...");
LogDecorators();
var compileUnit = new CodeCompileUnit();
var schemaCode = GenerateSchemaCode();
if (schemaCode != null)
{
compileUnit.Namespaces.Add(schemaCode);
}
compileUnit.Namespaces.Add(GenerateClientCode());
logger.Debug("Generation Complete.");
return compileUnit;
}
private void CreateResources(CodeNamespace clientNamespace,
string serviceClassName,
IResource resource,
RequestClassGenerator requestClassGenerator,
ResourceContainerGenerator resourceContainerGenerator)
{
foreach (var res in resource.Resources.Values.Concat(resource))
{
// Create the current list of used names.
IEnumerable<string> usedNames = resource.Resources.Keys;
// Create a class for the resource.
logger.Debug("Adding Resource {0}", res.Name);
var resourceGenerator = new ResourceClassGenerator(
res, serviceClassName, resourceDecorators, requestClassGenerator, resourceContainerGenerator,
usedNames);
var generatedClass = resourceGenerator.CreateClass();
clientNamespace.Types.Add(generatedClass);
}
}
private void LogDecorators()
{
if (logger.IsDebugEnabled)
{
logger.Debug("With Service Decorators:");
foreach (IServiceDecorator dec in serviceDecorators)
{
logger.Debug(">>>>" + dec);
}
logger.Debug("With Resource Decorators:");
foreach (IResourceDecorator dec in resourceDecorators)
{
logger.Debug(">>>>" + dec);
}
logger.Debug("With Resource Container Decorators:");
foreach (IResourceContainerDecorator dec in resourceContainerDecorators)
{
logger.Debug(">>>>" + dec);
}
}
}
private CodeNamespace CreateNamespace(string nameSpace)
{
return new CodeNamespace(nameSpace);
}
private void AddClientUsings(CodeNamespace codeNamespace)
{
codeNamespace.Imports.Add(new CodeNamespaceImport("System"));
codeNamespace.Imports.Add(new CodeNamespaceImport("System.IO"));
codeNamespace.Imports.Add(new CodeNamespaceImport("System.Collections.Generic"));
codeNamespace.Imports.Add(new CodeNamespaceImport("Google.Apis"));
codeNamespace.Imports.Add(new CodeNamespaceImport("Google.Apis.Discovery"));
}
private static string DataNamespace(string clientNamespace)
{
return clientNamespace + DataNamespaceExtension;
}
}
} | {
"content_hash": "9782f15389969b0fc3549ee6c5c6a8ca",
"timestamp": "",
"source": "github",
"line_count": 347,
"max_line_length": 124,
"avg_line_length": 43.789625360230545,
"alnum_prop": 0.5888779203685423,
"repo_name": "artzub/LoggenCSG",
"id": "302cd9cab3cbf132d54d45c42f767517267e0b98",
"size": "15765",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendors/gapi/Src/GoogleApis.Tools.CodeGen/GoogleServiceGenerator.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "1978161"
}
],
"symlink_target": ""
} |
<?php
namespace Nosco\Cashflows\Exceptions;
class Validation extends BaseException
{
}
| {
"content_hash": "0d47ffcf92e18f32134da273350e1dc9",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 42,
"avg_line_length": 15,
"alnum_prop": 0.6761904761904762,
"repo_name": "zanderbaldwin/cashflows",
"id": "dea946aa078ae68a2f64471d52ef53d0d1852e43",
"size": "105",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/Exceptions/Validation.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "48435"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<title>jQuery Chrony - A Count Down Plugin</title>
<style type="text/css">
/* This CSS does not belong to the plugin. */
body { background: url('img/background.gif'); font: normal 11px verdana; }
a { color: #2C8CBD; text-decoration: none; }
a:hover { color: #48A5D4; }
a#coffee {
background: url('img/coffee.png') 6px 2px no-repeat #DC5; border: 1px solid #D9C640; color: #FFF; display: block; float: right; font-size: 10px; font-weight: bold; letter-spacing: .9px; margin-right: 9px; padding: 4px 5px 4px 26px; text-decoration: none;
-khtml-border-radius: 4px; -moz-border-radius: 4px; -opera-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px;
}
a#coffee:hover { text-decoration: underline; }
span.comment { color: #999; font: 12px monospace; letter-spacing: .1px; margin-bottom: 7px; margin-top: 5px; }
div#content { background-color: #FFF; border: 1px solid #DEDEDE; box-shadow: 0 1px 3px rgba(100, 100, 100, 0.4); margin: 0 auto; padding: 15px; width: 1100px; min-height: 510px; }
div.description { color: #555; letter-spacing: .1px; margin-bottom: 15px; margin-top: 10px; text-align: left; }
div.description-code { color: #555; letter-spacing: .1px; margin-bottom: 10px; text-indent: 7px; }
div#menu-feature { color: #AAA; float: left; margin-bottom: 20px; }
div#menu-feature a { float: left; width: 120px }
div#menu-feature a.disabled { color: #999; cursor: default; }
div#menu-feature a.selected { color: #2C8CBD; cursor: default; font-weight: bold; }
div#footer { clear: both; height: 25px; margin-top: 5px; width: 100%; }
div#footer div#copy { margin: 0 auto; text-align: center; width: 1100px; }
div#header { margin: 0 auto; padding-left: 20px; width: 1130px; }
div#menu { color: #AB9927; font: bold 14px 'Lucida Grande', 'Helvetica', 'Times New Roman', serif; text-shadow: 1px 1px 1px #FFF; text-transform: uppercase; }
div#menu a { color: #EA9C00; font: bold 10px verdana; letter-spacing: .9px; text-decoration: none; }
div#menu a:hover { color: #DC5; font-weight: bold; letter-spacing: .9px; text-decoration: underline; }
div.session { clear: both; font: bold 13px verdana; border-bottom: 1px solid #EFEFEF; color: #444; letter-spacing: .7px; margin-bottom: 18px; margin-top: 24px; text-align: left; }
div.session-first { clear: both; font: bold 13px verdana; border-bottom: 1px solid #EFEFEF; color: #444; letter-spacing: .7px; margin-bottom: 18px; text-align: left; }
div.session-mini { font: bold 10px verdana; color: #444; letter-spacing: .7px; margin-top: 17px; }
div.source { background: #F8F8FF; border: 1px solid #EFEFEF; border-left: 3px solid #CCC; clear: both; color: #444; font: 12px monospace; border-radius: 2px; letter-spacing: .1px; margin-bottom: 7px; margin-top: 15px; padding: 7px; width: 1081px; -khtml-border-radius: 2px; -moz-border-radius: 2px; -opera-border-radius: 2px; -webkit-border-radius: 2px; }
div.source div.comment { color: #777; font: 9px verdana; letter-spacing: 0.4px; margin-bottom: 9px; text-align: left; }
div#title { font: bold 17px verdana; color: #269; letter-spacing: .7px; margin-bottom: 10px; text-align: left; }
div#title span { color: #777; font: 10px verdana; }
span#version { color: #777; font: 10px verdana; }
</style>
<script type="text/javascript">
// This code does NOT belong the plugin. See the example code at the bottom of this page.
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-194992347-11']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div id="header">
<div id="title">
<a href="http://wbotelhos.com/chrony">jQuery Chrony - A Count Down Plugin</a>
<span>(current version: 0.2.0)</span>
</div>
<div id="menu">
<a href="http://github.com/downloads/wbotelhos/chrony/jquery.chrony-0.2.0.zip" target="_blank">Download</a> |
<a href="http://github.com/wbotelhos/chrony" target="_blank">Github</a> |
<a href="http://www.wbotelhos.com/chrony/changelog.markdown" target="_blank">Change Log</a> |
<a href="http://www.wbotelhos.com/chrony/README.markdown" target="_blank">Readme</a> |
<a href="http://www.wbotelhos.com/2011/11/06/jquery-chrony-a-count-down-plugin" target="_blank">Article</a> |
<a href="http://www.wbotelhos.com/chrony/LICENSE.txt" target="_blank">License</a> |
<a href="http://www.wbotelhos.com/chrony/who.html" target="_blank">Who is using</a> |
<a href="http://www.wbotelhos.com/2011/11/06/jquery-chrony-a-count-down-plugin#comments" target="_blank" style="color: #2C8CBD;">Doubt</a> |
<a href="http://www.wbotelhos.com/labs" target="_blank" style="color: #000;">yLab</a>
</div>
<a id="coffee" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=X8HEP2878NDEG&item_name=jQuery%20Chrony" target="_blank">buy me a coffee</a>
<div class="description">Are you using jQuery <strong>Chrony</strong>? Send us the link of your site commenting <a href="http://www.wbotelhos.com/2011/11/06/jquery-chrony-a-count-down-plugin#comments" title="Send my link..." target="_blank" style="color: #2C8CBD;">here</a> and we'll add it on the list.</div>
</div>
<div id="content">
<div class="session-first">Who is using it:</div>
<div class="session-mini"></div>
<span class="comment">
</span>
</div>
<div id="footer">
<div id="copy">© 2011 <a href="http://www.wbotelhos.com" target="_blank">wbotelhos.com</a></div>
</div>
</body>
</html>
| {
"content_hash": "f076e29e62d3be38685143d3fb4ffe32",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 358,
"avg_line_length": 55.17272727272727,
"alnum_prop": 0.6673257538309442,
"repo_name": "wbotelhos/chrony",
"id": "e91d67f3db3537ed9b7691e883864ef0da334a53",
"size": "6069",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "who.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "97174"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013 Cloudera Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>kite-data-core</artifactId>
<parent>
<groupId>org.kitesdk</groupId>
<artifactId>kite-data</artifactId>
<version>0.12.2-SNAPSHOT</version>
</parent>
<name>Kite Data Core Module</name>
<description>
The Kite Data Core module provides simple, intuitive APIs for working with
datasets in the Hadoop Platform.
</description>
<build>
<resources>
<resource>
<directory>src/main/avro</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal> <!-- publish test-jar for other modules -->
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<skip>true</skip> <!-- jdiff is aggregated by parent -->
<excludePackageNames>org.kitesdk.data.spi.*</excludePackageNames>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<reportSets>
<reportSet>
<inherited>false</inherited>
<reports>
<report>index</report>
<report>summary</report>
<report>dependency-info</report>
<report>dependencies</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<skip>true</skip> <!-- javadoc is aggregated by parent -->
</configuration>
</plugin>
</plugins>
</reporting>
<dependencies>
<dependency>
<groupId>org.kitesdk</groupId>
<artifactId>${artifact.hadoop-deps}</artifactId>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.kitesdk</groupId>
<artifactId>${artifact.hadoop-test-deps}</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.twitter</groupId>
<artifactId>parquet-avro</artifactId>
<exclusions>
<exclusion>
<!-- exclude incompatibility with hadoop1 -->
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-jexl</artifactId>
</dependency>
<dependency>
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| {
"content_hash": "da88542b0929e2a26a821e825eda9d05",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 204,
"avg_line_length": 30.898936170212767,
"alnum_prop": 0.6245481149939749,
"repo_name": "tomwhite/kite",
"id": "b0f6337fa42c214fdd8b82dbea459e19f76fd6c7",
"size": "5809",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "kite-data/kite-data-core/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2694482"
},
{
"name": "Scala",
"bytes": "1300"
},
{
"name": "Shell",
"bytes": "1404"
},
{
"name": "XQuery",
"bytes": "2659"
},
{
"name": "XSLT",
"bytes": "835"
}
],
"symlink_target": ""
} |
// ReSharper disable RedundantCast
namespace Apache.Ignite.Core.Tests.Client.Cache
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Apache.Ignite.Core.Cache.Configuration;
using Apache.Ignite.Core.Client;
using Apache.Ignite.Core.Client.Cache;
using Apache.Ignite.Core.Client.DataStructures;
using Apache.Ignite.Core.Common;
using NUnit.Framework;
/// <summary>
/// Tests partition awareness functionality.
/// </summary>
public class PartitionAwarenessTest : ClientTestBase
{
/** */
private const int ServerCount = 3;
/** */
private ICacheClient<int, int> _cache;
/// <summary>
/// Initializes a new instance of the <see cref="PartitionAwarenessTest"/> class.
/// </summary>
public PartitionAwarenessTest()
: base(ServerCount, enableServerListLogging: true)
{
// No-op.
}
/// <summary>
/// Fixture set up.
/// </summary>
public override void FixtureSetUp()
{
base.FixtureSetUp();
_cache = Client.CreateCache<int, int>("c");
// Warm up client partition data.
InitTestData();
_cache.Get(1);
_cache.Get(2);
}
public override void TestSetUp()
{
base.TestSetUp();
InitTestData();
ClearLoggers();
}
[Test]
[TestCase(1, 1)]
[TestCase(2, 0)]
[TestCase(3, 0)]
[TestCase(4, 1)]
[TestCase(5, 1)]
[TestCase(6, 2)]
public void CacheGet_PrimitiveKeyType_RequestIsRoutedToPrimaryNode(int key, int gridIdx)
{
var res = _cache.Get(key);
Assert.AreEqual(key, res);
Assert.AreEqual(gridIdx, GetClientRequestGridIndex());
}
[Test]
[TestCase(1, 1)]
[TestCase(2, 0)]
[TestCase(3, 0)]
[TestCase(4, 1)]
[TestCase(5, 1)]
[TestCase(6, 2)]
public void CacheGetAsync_PrimitiveKeyType_RequestIsRoutedToPrimaryNode(int key, int gridIdx)
{
var res = _cache.GetAsync(key).Result;
Assert.AreEqual(key, res);
Assert.AreEqual(gridIdx, GetClientRequestGridIndex());
}
[Test]
[TestCase(1, 0)]
[TestCase(2, 0)]
[TestCase(3, 0)]
[TestCase(4, 2)]
[TestCase(5, 2)]
[TestCase(6, 1)]
public void CacheGet_UserDefinedKeyType_RequestIsRoutedToPrimaryNode(int key, int gridIdx)
{
var cache = Client.GetOrCreateCache<TestKey, int>("c_custom_key");
cache.PutAll(Enumerable.Range(1, 100).ToDictionary(x => new TestKey(x, x.ToString()), x => x));
cache.Get(new TestKey(1, "1")); // Warm up;
ClearLoggers();
var testKey = new TestKey(key, key.ToString());
var res = cache.Get(testKey);
Assert.AreEqual(key, res);
Assert.AreEqual(gridIdx, GetClientRequestGridIndex());
Assert.AreEqual(gridIdx, GetPrimaryNodeIdx(testKey));
}
[Test]
public void CachePut_UserDefinedTypeWithAffinityKey_ThrowsIgniteException()
{
// Note: annotation-based configuration is not supported on Java side.
// Use manual configuration instead.
var cacheClientConfiguration = new CacheClientConfiguration("c_custom_key_aff")
{
KeyConfiguration = new List<CacheKeyConfiguration>
{
new CacheKeyConfiguration(typeof(TestKeyWithAffinity))
{
AffinityKeyFieldName = "_i"
}
}
};
var cache = Client.GetOrCreateCache<TestKeyWithAffinity, int>(cacheClientConfiguration);
var ex = Assert.Throws<IgniteException>(() => cache.Put(new TestKeyWithAffinity(1, "1"), 1));
var expected = string.Format("Affinity keys are not supported. Object '{0}' has an affinity key.",
typeof(TestKeyWithAffinity));
Assert.AreEqual(expected, ex.Message);
}
#if NETCOREAPP // TODO: IGNITE-15710
[Test]
public void CacheGet_NewNodeEnteredTopology_RequestIsRoutedToNewNode()
{
// Warm-up.
Assert.AreEqual(1, _cache.Get(1));
// Before topology change.
Assert.AreEqual(12, _cache.Get(12));
Assert.AreEqual(1, GetClientRequestGridIndex());
Assert.AreEqual(14, _cache.Get(14));
Assert.AreEqual(2, GetClientRequestGridIndex());
// After topology change.
var cfg = GetIgniteConfiguration();
cfg.AutoGenerateIgniteInstanceName = true;
using (Ignition.Start(cfg))
{
TestUtils.WaitForTrueCondition(() =>
{
// Keys 12 and 14 belong to a new node now (-1).
Assert.AreEqual(12, _cache.Get(12));
if (GetClientRequestGridIndex() != -1)
{
return false;
}
Assert.AreEqual(14, _cache.Get(14));
Assert.AreEqual(-1, GetClientRequestGridIndex());
return true;
}, 6000);
}
}
#endif
[Test]
[TestCase(1, 1)]
[TestCase(2, 0)]
[TestCase(3, 0)]
[TestCase(4, 1)]
[TestCase(5, 1)]
[TestCase(6, 2)]
public void AllKeyBasedOperations_PrimitiveKeyType_RequestIsRoutedToPrimaryNode(int key, int gridIdx)
{
int unused;
TestOperation(() => _cache.Get(key), gridIdx);
TestAsyncOperation(() => _cache.GetAsync(key), gridIdx);
TestOperation(() => _cache.TryGet(key, out unused), gridIdx);
TestAsyncOperation(() => _cache.TryGetAsync(key), gridIdx);
TestOperation(() => _cache.Put(key, key), gridIdx, "Put");
TestAsyncOperation(() => _cache.PutAsync(key, key), gridIdx, "Put");
TestOperation(() => _cache.PutIfAbsent(key, key), gridIdx, "PutIfAbsent");
TestAsyncOperation(() => _cache.PutIfAbsentAsync(key, key), gridIdx, "PutIfAbsent");
TestOperation(() => _cache.GetAndPutIfAbsent(key, key), gridIdx, "GetAndPutIfAbsent");
TestAsyncOperation(() => _cache.GetAndPutIfAbsentAsync(key, key), gridIdx, "GetAndPutIfAbsent");
TestOperation(() => _cache.Clear(key), gridIdx, "ClearKey");
TestAsyncOperation(() => _cache.ClearAsync(key), gridIdx, "ClearKey");
TestOperation(() => _cache.ContainsKey(key), gridIdx, "ContainsKey");
TestAsyncOperation(() => _cache.ContainsKeyAsync(key), gridIdx, "ContainsKey");
TestOperation(() => _cache.GetAndPut(key, key), gridIdx, "GetAndPut");
TestAsyncOperation(() => _cache.GetAndPutAsync(key, key), gridIdx, "GetAndPut");
TestOperation(() => _cache.GetAndReplace(key, key), gridIdx, "GetAndReplace");
TestAsyncOperation(() => _cache.GetAndReplaceAsync(key, key), gridIdx, "GetAndReplace");
TestOperation(() => _cache.GetAndRemove(key), gridIdx, "GetAndRemove");
TestAsyncOperation(() => _cache.GetAndRemoveAsync(key), gridIdx, "GetAndRemove");
TestOperation(() => _cache.Replace(key, key), gridIdx, "Replace");
TestAsyncOperation(() => _cache.ReplaceAsync(key, key), gridIdx, "Replace");
TestOperation(() => _cache.Replace(key, key, key + 1), gridIdx, "ReplaceIfEquals");
TestAsyncOperation(() => _cache.ReplaceAsync(key, key, key + 1), gridIdx, "ReplaceIfEquals");
TestOperation(() => _cache.Remove(key), gridIdx, "RemoveKey");
TestAsyncOperation(() => _cache.RemoveAsync(key), gridIdx, "RemoveKey");
TestOperation(() => _cache.Remove(key, key), gridIdx, "RemoveIfEquals");
TestAsyncOperation(() => _cache.RemoveAsync(key, key), gridIdx, "RemoveIfEquals");
}
[Test]
public void CacheGet_RepeatedCall_DoesNotRequestAffinityMapping()
{
// Test that affinity mapping is not requested when known.
// Start new cache to enforce partition mapping request.
Client.CreateCache<int, int>("repeat-call-test");
ClearLoggers();
_cache.Get(1);
_cache.Get(1);
_cache.Get(1);
var requests = GetAllServerRequestNames(RequestNamePrefixCache);
var expectedRequests = new[]
{
"Partitions",
"Get",
"Get",
"Get"
};
CollectionAssert.AreEquivalent(expectedRequests, requests);
}
[Test]
public void ReplicatedCacheGet_RepeatedCall_DoesNotRequestAffinityMapping()
{
// Test cache for which partition awareness is not applicable.
var cfg = new CacheClientConfiguration("replicated_cache") {CacheMode = CacheMode.Replicated};
var cache = Client.CreateCache<int, int>(cfg);
// Init the replicated cache and start the new one to enforce partition mapping request.
cache.PutAll(Enumerable.Range(1, 3).ToDictionary(x => x, x => x));
Client.CreateCache<int, int>("repeat-call-test-replicated");
ClearLoggers();
cache.Get(1);
cache.Get(2);
cache.Get(3);
var reqs = GetLoggers()
.Select(l => GetServerRequestNames(l, RequestNamePrefixCache).ToArray())
.Where(x => x.Length > 0)
.ToArray();
// All requests should go to a single (default) node, because partition awareness is not applicable.
Assert.AreEqual(1, reqs.Length);
// There should be only one partitions request.
var expectedRequests = new[]
{
"Partitions",
"Get",
"Get",
"Get"
};
Assert.AreEqual(expectedRequests, reqs[0]);
}
[Test]
public void CacheGet_PartitionAwarenessDisabled_RequestIsRoutedToDefaultNode()
{
var cfg = GetClientConfiguration();
cfg.EnablePartitionAwareness = false;
using (var client = Ignition.StartClient(cfg))
{
var cache = client.GetCache<int, int>(_cache.Name);
var requestTargets = Enumerable
.Range(1, 10)
.Select(x =>
{
cache.Get(x);
return GetClientRequestGridIndex();
})
.Distinct()
.ToArray();
// Partition awareness disabled - all requests go to same socket, picked with round-robin on connect.
Assert.AreEqual(1, requestTargets.Length);
}
}
// ReSharper disable RedundantExplicitArrayCreation
[Test]
[TestCase(1, 1)]
[TestCase(2, 0)]
[TestCase((uint) 1, 1)]
[TestCase(uint.MaxValue, 0)]
[TestCase((byte) 1, 1)]
[TestCase((byte) 2, 0)]
[TestCase((byte) 131, 1)]
[TestCase((sbyte) 1, 1)]
[TestCase((sbyte) -2, 1)]
[TestCase((short) 1, 1)]
[TestCase((short) 2, 0)]
[TestCase((ushort) 1, 1)]
[TestCase(ushort.MaxValue, 0)]
[TestCase((long) 1, 1)]
[TestCase((long) 2, 0)]
[TestCase((ulong) 1, 1)]
[TestCase(ulong.MaxValue, 0)]
[TestCase((float) 1.3, 0)]
[TestCase((float) 1.4, 2)]
[TestCase((double) 51.3, 1)]
[TestCase((double) 415.5, 0)]
[TestCase((double) 325.5, 0)]
[TestCase((double) 255.5, 1)]
[TestCase('1', 2)]
[TestCase('2', 1)]
[TestCase("1", 2)]
[TestCase("2", 1)]
[TestCase("Hello World", 0)]
[TestCase("Тест1", 1)]
[TestCase("🙂🔥😎", 2)]
[TestCase(true, 1)]
[TestCase(false, 1)]
[TestCase(new[]{true, false}, 1)]
[TestCase(new byte[]{1, 2}, 2)]
[TestCase(new sbyte[]{1, -2}, 0)]
[TestCase(new short[]{1, 3}, 2)]
[TestCase(new ushort[]{1, 4}, 2)]
[TestCase(new int[]{1, 5}, 2)]
[TestCase(new uint[]{1, 6}, 1)]
[TestCase(new long[]{1, 7}, 0)]
[TestCase(new ulong[]{1, 8}, 0)]
[TestCase(new float[]{1.1f, 9.9f}, 1)]
[TestCase(new double[]{1.2f, 19.19f}, 1)]
[TestCase(new char[]{'x', 'y'}, 1)]
[TestCase(new string[]{"Hello", "World"}, 2)]
// ReSharper restore RedundantExplicitArrayCreation
public void CachePut_AllPrimitiveTypes_RequestIsRoutedToPrimaryNode(object key, int gridIdx)
{
var cache = Client.GetCache<object, object>(_cache.Name);
TestOperation(() => cache.Put(key, key), gridIdx, "Put");
// Verify against real Affinity.
Assert.AreEqual(gridIdx, GetPrimaryNodeIdx(key), "Actual primary node is different");
}
[Test]
[TestCase("00000000-0000-0000-0000-000000000000", 0)]
[TestCase("0cb85a41-bd0d-405b-8f34-f515e8aabc39", 0)]
[TestCase("b4addd17-218c-4054-a5fa-03c88f5ee71c", 0)]
[TestCase("2611e3d2-618d-43b9-a318-2f5039f82568", 1)]
[TestCase("1dd8bfae-29b8-4949-aa99-7c9bfabe2566", 2)]
public void CachePut_GuidKey_RequestIsRoutedToPrimaryNode(string keyString, int gridIdx)
{
var key = Guid.Parse(keyString);
var cache = Client.GetCache<object, object>(_cache.Name);
TestOperation(() => cache.Put(key, key), gridIdx, "Put");
// Verify against real Affinity.
Assert.AreEqual(gridIdx, GetPrimaryNodeIdx(key));
}
[Test]
[TestCase("2015-01-01T00:00:00.0000000Z", 2)]
[TestCase("2016-02-02T00:00:00.0000000Z", 2)]
[TestCase("2017-03-03T00:00:00.0000000Z", 0)]
public void CachePut_DateTimeKey_RequestIsRoutedToPrimaryNode(string keyString, int gridIdx)
{
var key = DateTime.Parse(keyString, CultureInfo.InvariantCulture).ToUniversalTime();
var cache = Client.GetCache<object, object>(_cache.Name);
TestOperation(() => cache.Put(key, key), gridIdx, "Put");
// Verify against real Affinity.
Assert.AreEqual(gridIdx, GetPrimaryNodeIdx(key));
}
[Test]
[TestCase(1, 1)]
[TestCase(2, 0)]
public void CachePut_IntPtrKeyKey_RequestIsRoutedToPrimaryNode(int keyInt, int gridIdx)
{
var key = new IntPtr(keyInt);
var cache = Client.GetCache<object, object>(_cache.Name);
TestOperation(() => cache.Put(key, key), gridIdx, "Put");
// Verify against real Affinity.
Assert.AreEqual(gridIdx, GetPrimaryNodeIdx(key));
}
[Test]
[TestCase(1, 1)]
[TestCase(2, 0)]
public void CachePut_UIntPtrKeyKey_RequestIsRoutedToPrimaryNode(int keyInt, int gridIdx)
{
var key = new UIntPtr((uint) keyInt);
var cache = Client.GetCache<object, object>(_cache.Name);
TestOperation(() => cache.Put(key, key), gridIdx, "Put");
// Verify against real Affinity.
Assert.AreEqual(gridIdx, GetPrimaryNodeIdx(key));
}
[Test]
[TestCase(1, 1)]
[TestCase(2, 0)]
[TestCase(3, 0)]
[TestCase(4, 1)]
[TestCase(5, 1)]
[TestCase(6, 2)]
public void DataStreamer_PrimitiveKeyType_RequestIsRoutedToPrimaryNode(int key, int gridIdx)
{
using (var streamer = Client.GetDataStreamer<int, int>(_cache.Name))
{
streamer.Add(key, key);
}
Assert.AreEqual(gridIdx, GetClientRequestGridIndex("Start", RequestNamePrefixStreamer));
}
[Test]
[TestCase("default-grp-partitioned", null, CacheMode.Partitioned, 0)]
[TestCase("default-grp-replicated", null, CacheMode.Replicated, 2)]
[TestCase("custom-grp-partitioned", "testAtomicLong", CacheMode.Partitioned, 1)]
[TestCase("custom-grp-replicated", "testAtomicLong", CacheMode.Replicated, 0)]
public void AtomicLong_RequestIsRoutedToPrimaryNode(
string name, string groupName, CacheMode cacheMode, int gridIdx)
{
var cfg = new AtomicClientConfiguration
{
GroupName = groupName,
CacheMode = cacheMode
};
var atomicLong = Client.GetAtomicLong(name, cfg, 1, true);
// Warm up.
atomicLong.Read();
ClearLoggers();
// Test.
atomicLong.Read();
Assert.AreEqual(gridIdx, GetClientRequestGridIndex("ValueGet", "datastructures.ClientAtomicLong"));
}
[Test]
[TestCase("default-grp-partitioned-set", null, CacheMode.Partitioned, 1, 1)]
[TestCase("default-grp-partitioned-set", null, CacheMode.Partitioned, 2, 0)]
[TestCase("default-grp-partitioned-set", null, CacheMode.Partitioned, 3, 0)]
[TestCase("default-grp-partitioned-set", null, CacheMode.Partitioned, 4, 1)]
[TestCase("custom-grp-partitioned-set", "testIgniteSet1", CacheMode.Partitioned, 1, 1)]
[TestCase("custom-grp-partitioned-set", "testIgniteSet1", CacheMode.Partitioned, 3, 0)]
[TestCase("custom-grp-replicated-set", "testIgniteSet2", CacheMode.Replicated, 1, 1)]
[TestCase("custom-grp-replicated-set", "testIgniteSet2", CacheMode.Replicated, 3, 1)]
public void IgniteSet_RequestIsRoutedToPrimaryNode(
string name, string groupName, CacheMode cacheMode, int item, int gridIdx)
{
var cfg = new CollectionClientConfiguration
{
GroupName = groupName,
CacheMode = cacheMode,
Backups = 1
};
var igniteSet = Client.GetIgniteSet<int>(name, cfg);
// Warm up.
igniteSet.Add(0);
ClearLoggers();
// Test.
igniteSet.Add(item);
Assert.AreEqual(gridIdx, GetClientRequestGridIndex("ValueAdd", "datastructures.ClientIgniteSet"));
}
[Test]
[TestCase("default-grp-partitioned-set-2", null, CacheMode.Partitioned, 1, 0)]
[TestCase("default-grp-partitioned-set-2", null, CacheMode.Partitioned, 2, 0)]
[TestCase("default-grp-partitioned-set-2", null, CacheMode.Partitioned, 3, 0)]
[TestCase("default-grp-partitioned-set-2", null, CacheMode.Partitioned, 4, 0)]
[TestCase("custom-grp-partitioned-set-2", "testIgniteSetColocated1", CacheMode.Partitioned, 1, 1)]
[TestCase("custom-grp-partitioned-set-2", "testIgniteSetColocated1", CacheMode.Partitioned, 2, 1)]
[TestCase("custom-grp-partitioned-set-2", "testIgniteSetColocated1", CacheMode.Partitioned, 3, 1)]
[TestCase("custom-grp-replicated-set-2", "testIgniteSetColocated2", CacheMode.Replicated, 1, 1)]
[TestCase("custom-grp-replicated-set-2", "testIgniteSetColocated2", CacheMode.Replicated, 2, 1)]
[TestCase("custom-grp-replicated-set-2", "testIgniteSetColocated2", CacheMode.Replicated, 3, 1)]
public void IgniteSetColocated_RequestIsRoutedToPrimaryNode(
string name, string groupName, CacheMode cacheMode, int item, int gridIdx)
{
var cfg = new CollectionClientConfiguration
{
GroupName = groupName,
CacheMode = cacheMode,
Colocated = true,
Backups = 1
};
var igniteSet = Client.GetIgniteSet<int>(name, cfg);
// Warm up.
igniteSet.Add(0);
ClearLoggers();
// Test.
igniteSet.Add(1);
Assert.AreEqual(gridIdx, GetClientRequestGridIndex("ValueAdd", "datastructures.ClientIgniteSet"));
}
protected override IgniteClientConfiguration GetClientConfiguration()
{
var cfg = base.GetClientConfiguration();
cfg.EnablePartitionAwareness = true;
cfg.Endpoints.Add(string.Format("{0}:{1}", IPAddress.Loopback, IgniteClientConfiguration.DefaultPort + 1));
cfg.Endpoints.Add(string.Format("{0}:{1}", IPAddress.Loopback, IgniteClientConfiguration.DefaultPort + 2));
return cfg;
}
private int GetClientRequestGridIndex(string message = null, string prefix = null)
{
message = message ?? "Get";
try
{
for (var i = 0; i < ServerCount; i++)
{
var requests = GetServerRequestNames(i, prefix ?? RequestNamePrefixCache);
if (requests.Contains(message))
{
return i;
}
}
return -1;
}
finally
{
ClearLoggers();
}
}
private void TestOperation(Action action, int expectedGridIdx, string message = null)
{
InitTestData();
ClearLoggers();
action();
Assert.AreEqual(expectedGridIdx, GetClientRequestGridIndex(message));
}
private void TestAsyncOperation<T>(Func<T> action, int expectedGridIdx, string message = null)
where T : Task
{
ClearLoggers();
action().Wait();
Assert.AreEqual(expectedGridIdx, GetClientRequestGridIndex(message));
}
private void InitTestData()
{
_cache.PutAll(Enumerable.Range(1, 100).ToDictionary(x => x, x => x));
}
private int GetPrimaryNodeIdx<T>(T key)
{
var idx = 0;
// GetAll is not ordered - sort the same way as _loggers.
var ignites = Ignition.GetAll().OrderBy(i => i.Name);
foreach (var ignite in ignites)
{
var aff = ignite.GetAffinity(_cache.Name);
var localNode = ignite.GetCluster().GetLocalNode();
if (aff.IsPrimary(localNode, key))
{
return idx;
}
idx++;
}
throw new InvalidOperationException("Can't determine primary node");
}
}
}
| {
"content_hash": "e9421caf403c554387ffd04e035c0e62",
"timestamp": "",
"source": "github",
"line_count": 621,
"max_line_length": 119,
"avg_line_length": 36.81642512077295,
"alnum_prop": 0.5583256790447448,
"repo_name": "apache/ignite",
"id": "d6adb4929ad02cf5758cf5e5c927a471c071c96f",
"size": "23678",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "modules/platforms/dotnet/Apache.Ignite.Core.Tests/Client/Cache/PartitionAwarenessTest.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "55118"
},
{
"name": "C",
"bytes": "7601"
},
{
"name": "C#",
"bytes": "7749887"
},
{
"name": "C++",
"bytes": "4522204"
},
{
"name": "CMake",
"bytes": "54473"
},
{
"name": "Dockerfile",
"bytes": "12067"
},
{
"name": "FreeMarker",
"bytes": "18828"
},
{
"name": "HTML",
"bytes": "14341"
},
{
"name": "Java",
"bytes": "50663394"
},
{
"name": "JavaScript",
"bytes": "1085"
},
{
"name": "Jinja",
"bytes": "33639"
},
{
"name": "Makefile",
"bytes": "932"
},
{
"name": "PHP",
"bytes": "11079"
},
{
"name": "PowerShell",
"bytes": "9247"
},
{
"name": "Python",
"bytes": "336150"
},
{
"name": "Scala",
"bytes": "425434"
},
{
"name": "Shell",
"bytes": "311819"
}
],
"symlink_target": ""
} |
#ifndef VEXCL_BACKEND_CUDA_CONTEXT_HPP
#define VEXCL_BACKEND_CUDA_CONTEXT_HPP
/**
* \file vexcl/backend/cuda/context.hpp
* \author Denis Demidov <[email protected]>
* \brief CUDA device enumeration and context initialization.
*/
#include <vector>
#include <tuple>
#include <iostream>
#include <memory>
#include <cuda.h>
namespace vex {
namespace backend {
/// The CUDA backend.
namespace cuda {
inline CUresult do_init() {
static const CUresult rc = cuInit(0);
return rc;
}
namespace detail {
template <class Handle>
struct deleter_impl;
template <>
struct deleter_impl<CUcontext> {
static void dispose(CUcontext context) {
cuda_check( cuCtxSetCurrent(context) );
cuda_check( cuCtxSynchronize() );
cuda_check( cuCtxDestroy(context) );
}
};
template <>
struct deleter_impl<CUmodule> {
static void dispose(CUmodule module) {
cuda_check( cuModuleUnload(module) );
}
};
template <>
struct deleter_impl<CUstream> {
static void dispose(CUstream stream) {
cuda_check( cuStreamDestroy(stream) );
}
};
// Knows how to dispose of various CUDA handles.
struct deleter {
deleter(CUcontext ctx) : ctx(ctx) {}
template <class Handle>
void operator()(Handle handle) const {
if (ctx) cuda_check( cuCtxSetCurrent(ctx) );
deleter_impl<Handle>::dispose(handle);
}
CUcontext ctx;
};
}
/// Wrapper around CUdevice.
class device {
public:
/// Empty constructor.
device() {}
/// Constructor.
device(CUdevice d) : d(d) {}
/// Returns raw CUdevice handle.
CUdevice raw() const { return d; }
/// Returns raw CUdevice handle.
operator CUdevice() const { return d; }
/// Returns name of the device.
std::string name() const {
char name[256];
cuda_check( cuDeviceGetName(name, 256, d) );
return name;
}
/// Returns device compute capability as a tuple of major and minor version numbers.
std::tuple<int, int> compute_capability() const {
int major, minor;
cuda_check( cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, d) );
cuda_check( cuDeviceGetAttribute(&minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, d) );
return std::make_tuple(major, minor);
}
/// Returns of multiprocessors on the device.
size_t multiprocessor_count() const {
int n;
cuda_check( cuDeviceGetAttribute(&n, CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT, d) );
return n;
}
/// Returns maximum number of threads per block.
size_t max_threads_per_block() const {
int n;
cuda_check( cuDeviceGetAttribute(&n, CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK, d) );
return n;
}
/// Returns maximum amount of shared memory available to a thread block in bytes.
size_t max_shared_memory_per_block() const {
int n;
cuda_check( cuDeviceGetAttribute(&n, CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK, d) );
return n;
}
size_t warp_size() const {
int n;
cuda_check( cuDeviceGetAttribute(&n, CU_DEVICE_ATTRIBUTE_WARP_SIZE, d) );
return n;
}
private:
CUdevice d;
};
/// Wrapper around CUcontext.
class context {
public:
/// Empty constructor.
context() {}
/// Creates a CUDA context.
context(device dev, unsigned flags = 0)
: c( create(dev, flags), detail::deleter(0) )
{
cuda_check( do_init() );
}
/// Returns raw CUcontext handle.
CUcontext raw() const {
return c.get();
}
/// Returns raw CUcontext handle.
operator CUcontext() const {
return c.get();
}
/// Binds the context to the calling CPU thread.
void set_current() const {
cuda_check( cuCtxSetCurrent( c.get() ) );
}
private:
std::shared_ptr<std::remove_pointer<CUcontext>::type> c;
static CUcontext create(device dev, unsigned flags) {
CUcontext h = 0;
cuda_check( cuCtxCreate(&h, flags, dev.raw()) );
return h;
}
};
/// Command queue creation flags.
/**
* typedef'ed to cl_command_queue_properties in the OpenCL backend and to
* unsigned in the CUDA backend. See OpenCL/CUDA documentation for the possible
* values.
*/
typedef unsigned command_queue_properties;
/// Command queue.
/** With the CUDA backend, this is a wrapper around CUstream. */
class command_queue {
public:
/// Empty constructor.
command_queue() {}
/// Create command queue for the given context and device.
command_queue(const vex::backend::context &ctx, vex::backend::device dev, unsigned flags)
: ctx(ctx), dev(dev), s( create(ctx, flags), detail::deleter(ctx.raw()) ), f(flags)
{ }
/// Blocks until all previously queued commands in command_queue are issued to the associated device and have completed.
void finish() const {
ctx.set_current();
cuda_check( cuStreamSynchronize( s.get() ) );
}
/// Returns the context associated with the command queue.
vex::backend::context context() const {
return ctx;
}
/// Returns the device associated with the command queue.
vex::backend::device device() const {
return dev;
}
/// Returns command_queue_properties specified at creation.
unsigned flags() const {
return f;
}
/// Returns raw CUstream handle for the command queue.
CUstream raw() const {
return s.get();
}
/// Returns raw CUstream handle for the command queue.
operator CUstream() const {
return s.get();
}
private:
vex::backend::context ctx;
vex::backend::device dev;
std::shared_ptr<std::remove_pointer<CUstream>::type> s;
unsigned f;
static CUstream create(const vex::backend::context &ctx, unsigned flags = 0) {
ctx.set_current();
CUstream s;
cuda_check( cuStreamCreate(&s, flags) );
return s;
}
};
/// CUmodule wrapper.
struct program {
public:
program() {}
program(vex::backend::context c, CUmodule m)
: c(c), m(m, detail::deleter(c.raw()))
{}
CUmodule raw() const {
return m.get();
}
operator CUmodule() const {
return m.get();
}
private:
vex::backend::context c;
std::shared_ptr<std::remove_pointer<CUmodule>::type> m;
};
/// Binds the specified CUDA context to the calling CPU thread.
inline void select_context(const command_queue &q) {
q.context().set_current();
}
/// Raw device handle.
typedef CUdevice device_id;
/// Returns device associated with the given queue.
inline device get_device(const command_queue &q) {
return q.device();
}
/// Returns id of the device associated with the given queue.
inline device_id get_device_id(const command_queue &q) {
return q.device().raw();
}
/// Launch grid size.
struct ndrange {
size_t x, y, z;
ndrange(size_t x = 1, size_t y = 1, size_t z = 1)
: x(x), y(y), z(z) {}
};
typedef CUcontext context_id;
/// Returns raw context id for the given queue.
inline context_id get_context_id(const command_queue &q) {
return q.context().raw();
}
/// Returns context for the given queue.
inline context get_context(const command_queue &q) {
return q.context();
}
/// Compares contexts by raw ids.
struct compare_contexts {
bool operator()(const context &a, const context &b) const {
return a.raw() < b.raw();
}
};
/// Compares queues by raw ids.
struct compare_queues {
bool operator()(const command_queue &a, const command_queue &b) const {
return a.raw() < b.raw();
}
};
/// Create command queue on the same context and device as the given one.
inline command_queue duplicate_queue(const command_queue &q) {
return command_queue(q.context(), q.device(), q.flags());
}
/// Checks if the compute device is CPU.
/**
* Always returns false with the CUDA backend.
*/
inline bool is_cpu(const command_queue&) {
return false;
}
/// Select devices by given criteria.
/**
* \param filter Device filter functor. Functors may be combined with logical
* operators.
* \returns list of devices satisfying the provided filter.
*/
template<class DevFilter>
std::vector<device> device_list(DevFilter&& filter) {
cuda_check( do_init() );
std::vector<device> device;
int ndev;
cuda_check( cuDeviceGetCount(&ndev) );
for(int d = 0; d < ndev; ++d) {
try {
CUdevice dev;
cuda_check( cuDeviceGet(&dev, d) );
if (!filter(dev)) continue;
device.push_back(dev);
} catch(const error&) { }
}
return device;
}
/// Create command queues on devices by given criteria.
/**
* \param filter Device filter functor. Functors may be combined with logical
* operators.
* \param properties Command queue properties.
*
* \returns list of queues accociated with selected devices.
* \see device_list
*/
template<class DevFilter>
std::pair< std::vector<context>, std::vector<command_queue> >
queue_list(DevFilter &&filter, unsigned queue_flags = 0)
{
cuda_check( do_init() );
std::vector<context> ctx;
std::vector<command_queue> queue;
int ndev;
cuda_check( cuDeviceGetCount(&ndev) );
for(int d = 0; d < ndev; ++d) {
try {
CUdevice dev;
cuda_check( cuDeviceGet(&dev, d) );
if (!filter(dev)) continue;
context c(dev);
command_queue q(c, dev, queue_flags);
ctx.push_back(c);
queue.push_back(q);
} catch(const error&) { }
}
return std::make_pair(ctx, queue);
}
} // namespace cuda
} // namespace backend
} // namespace vex
namespace std {
/// Output device name to stream.
inline std::ostream& operator<<(std::ostream &os, const vex::backend::cuda::device &d)
{
return os << d.name();
}
/// Output device name to stream.
inline std::ostream& operator<<(std::ostream &os, const vex::backend::cuda::command_queue &q)
{
return os << q.device();
}
} // namespace std
#endif
| {
"content_hash": "538fb1abf56f791e0eed4d429c490a9b",
"timestamp": "",
"source": "github",
"line_count": 410,
"max_line_length": 128,
"avg_line_length": 25.982926829268294,
"alnum_prop": 0.5961700929315685,
"repo_name": "ddemidov/vexcl",
"id": "f5a91b39521f6825510e9238bda33e9a3c484f76",
"size": "11765",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vexcl/backend/cuda/context.hpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "1845850"
},
{
"name": "CMake",
"bytes": "29557"
},
{
"name": "Shell",
"bytes": "1088"
}
],
"symlink_target": ""
} |
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRODUCTS_DIR}/$1"
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elif [ -r "$1" ]; then
local source="$1"
fi
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# Use filter instead of exclude so missing patterns don't throw errors.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
strip_invalid_archs "$binary"
fi
# Resign the code if required by the build settings to avoid unstable apps
code_sign_if_enabled "${destination}/$(basename "$1")"
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
fi
}
# Copies the dSYM of a vendored framework
install_dsym() {
local source="$1"
if [ -r "$source" ]; then
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}"
fi
}
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
code_sign_cmd="$code_sign_cmd &"
fi
echo "$code_sign_cmd"
eval "$code_sign_cmd"
fi
}
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
}
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/CDBKit-iOS/CDBKit.framework"
install_framework "${BUILT_PRODUCTS_DIR}/CDBUUID-iOS/CDBUUID.framework"
install_framework "${BUILT_PRODUCTS_DIR}/CDBiCloudKit-iOS/CDBiCloudKit.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/CDBKit-iOS/CDBKit.framework"
install_framework "${BUILT_PRODUCTS_DIR}/CDBUUID-iOS/CDBUUID.framework"
install_framework "${BUILT_PRODUCTS_DIR}/CDBiCloudKit-iOS/CDBiCloudKit.framework"
fi
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
wait
fi
| {
"content_hash": "7948acc17445c7eaf6952b014f3fb24b",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 263,
"avg_line_length": 43.2,
"alnum_prop": 0.6388888888888888,
"repo_name": "truebucha/CDBiCloudKit",
"id": "a4c480eb31048b88be7741d1c7d26915e1b672d9",
"size": "4978",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Example/Pods/Target Support Files/Pods-Pod-CDBiCloudKit_Example/Pods-Pod-CDBiCloudKit_Example-frameworks.sh",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "146914"
},
{
"name": "Ruby",
"bytes": "2342"
},
{
"name": "Shell",
"bytes": "30975"
}
],
"symlink_target": ""
} |
//-----------------------------------------------------------------------
// <copyright file="ERitem.cs" company="Marimer LLC">
// Copyright (c) Marimer LLC. All rights reserved.
// Website: https://cslanet.com
// </copyright>
// <summary>no summary</summary>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
namespace Csla.Test.EditableRootList
{
[Serializable]
public class ERitem : BusinessBase<ERitem>
{
public static PropertyInfo<string> DataProperty = RegisterProperty<string>(c => c.Data);
public string Data
{
get { return GetProperty(DataProperty); }
set { SetProperty(DataProperty, value); }
}
private ERitem()
{ /* require use of factory methods */ }
private ERitem(string data)
{
using (BypassPropertyChecks)
Data = data;
MarkOld();
}
public static ERitem NewItem()
{
return new ERitem();
}
public static ERitem GetItem(string data)
{
return new ERitem(data);
}
protected override void DataPortal_Insert()
{
ApplicationContext.GlobalContext["DP"] = "Insert";
}
protected override void DataPortal_Update()
{
ApplicationContext.GlobalContext["DP"] = "Update";
}
protected override void DataPortal_DeleteSelf()
{
ApplicationContext.GlobalContext["DP"] = "DeleteSelf";
}
protected void DataPortal_Delete(object criteria)
{
ApplicationContext.GlobalContext["DP"] = "Delete";
}
}
} | {
"content_hash": "7889ab6a7f5d561e41385f15914bc9fe",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 92,
"avg_line_length": 24.6875,
"alnum_prop": 0.5867088607594937,
"repo_name": "jonnybee/csla",
"id": "0e0ac8b2b1a6984aee88a582d121a2a69f45ea43",
"size": "1580",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/Csla.test/EditableRootList/ERitem.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "123"
},
{
"name": "C#",
"bytes": "4084184"
},
{
"name": "HTML",
"bytes": "31684"
},
{
"name": "PowerShell",
"bytes": "25158"
},
{
"name": "Shell",
"bytes": "533"
},
{
"name": "Visual Basic",
"bytes": "35331"
}
],
"symlink_target": ""
} |
extern int external1;
extern int external2;
//extern static int external2; // "main.c:14: error: multiple storage classes in
// declaration specifiers"
////////////////////////////////////////////////////////////////////////////////
int main(void) {
printf("Initial values:\n");
Print(external1);
Print(external2);
printf("Running object's internal adder:\n");
add_to_external1();
add_to_external2();
Print(external1);
Print(external2);
printf("Running objects's external adder:\n");
++external1;
++external2;
Print(external1);
Print(external2);
return 0;
}
| {
"content_hash": "f2ac4f73b9db510ed685ddf761c6f15d",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 80,
"avg_line_length": 24.28,
"alnum_prop": 0.5831960461285008,
"repo_name": "DeadDork/learning_c",
"id": "b87b6458d09ab5769f21c5f1dcac7fdde1faba58",
"size": "921",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "experiments/static_dos/main.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Awk",
"bytes": "96"
},
{
"name": "C",
"bytes": "539807"
},
{
"name": "Shell",
"bytes": "214"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "ce3c3f37db4b430151fb11b2c2de1b19",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "eca5536d7477ce5a49d0d30d3d1b9ce5813c1a83",
"size": "183",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Puccinellia/Puccinellia preslii/ Syn. Puccinellia parodii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package brooklyn.entity.basic;
public class BasicEntityImpl extends AbstractEntity implements BasicEntity {
public BasicEntityImpl() {
}
}
| {
"content_hash": "829425b54de6d20a28509277fda44137",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 76,
"avg_line_length": 17.22222222222222,
"alnum_prop": 0.7419354838709677,
"repo_name": "neykov/incubator-brooklyn",
"id": "6f9be4404500b835bee7a40284ade86fb80455a5",
"size": "964",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/src/main/java/brooklyn/entity/basic/BasicEntityImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "105605"
},
{
"name": "Groovy",
"bytes": "356057"
},
{
"name": "Java",
"bytes": "11248156"
},
{
"name": "JavaScript",
"bytes": "2102964"
},
{
"name": "PHP",
"bytes": "6084"
},
{
"name": "Perl",
"bytes": "8072"
},
{
"name": "PowerShell",
"bytes": "4962"
},
{
"name": "Ruby",
"bytes": "10571"
},
{
"name": "Shell",
"bytes": "49871"
}
],
"symlink_target": ""
} |
#ifndef TENSORFLOW_COMPILER_MLIR_XLA_MLIR_HLO_TO_HLO_H_
#define TENSORFLOW_COMPILER_MLIR_XLA_MLIR_HLO_TO_HLO_H_
#include "mlir/Dialect/Func/IR/FuncOps.h" // from @llvm-project
#include "mlir/IR/BuiltinOps.h" // from @llvm-project
#include "tensorflow/compiler/mlir/tensorflow/utils/error_util.h"
#include "tensorflow/compiler/tf2xla/layout_util.h"
#include "tensorflow/compiler/tf2xla/xla_helpers.h"
#include "tensorflow/compiler/xla/client/xla_builder.h"
#include "tensorflow/compiler/xla/service/hlo_module.h"
#include "tensorflow/core/framework/tensor_shape.h"
namespace mlir {
struct MlirToHloConversionOptions {
// Best-effort propagation of the layouts. These layouts serve as performance
// hints to the backend.
//
// Note that non-array shapes are not carrying layouts, and users have to
// figure out the proper layouts of them through context. This is one of the
// reasons why the attribute-based solution is temporary.
//
// TODO(timshen): Investigate the necessity of having layouts in MHLO.
bool propagate_layouts = false;
// Propagate the source and result layouts from mhlo bitcast op into the
// backend config for the bitcast. This is required for XLA:GPU backend to
// use elemental IR emitters for fused bitcasts without propagating layouts.
bool propagate_bitcast_layouts_to_backend_config = false;
// Legalize names to be compatible with TensorFlow.
bool legalize_node_names = true;
};
// Converts a MLIR module in HLO dialect into a HloModuleProto. If
// use_tuple_args is set, then the entry computations's arguments are converted
// to a tuple and passed as a single parameter.
// Similarly, if return tuple is true, then the entry function's return values
// are converted to a tuple even when there is only a single return value.
// Multiple return values are always converted to a tuple and returned as a
// single value.
//
// TODO(timshen): move other options into `options`.
Status ConvertMlirHloToHlo(
mlir::ModuleOp module, ::xla::HloProto* hlo_proto, bool use_tuple_args,
bool return_tuple,
const tensorflow::XlaShapeLayoutHelpers::ShapeDeterminationFns
shape_determination_fns = {},
MlirToHloConversionOptions options = {});
// Transforms a Block into HLO, where the HLO is represented as calls into an
// XlaBuilder. Callee functions are allowed in the Block's ancestor ModuleOp.
// xla_params are inputs to block. returns are the returned XlaOps.
Status BuildHloFromMlirHlo(mlir::Block& block, xla::XlaBuilder& builder,
llvm::ArrayRef<xla::XlaOp> xla_params,
std::vector<xla::XlaOp>& returns,
MlirToHloConversionOptions options = {});
// Converts a region to a computation. It returns a standalone module that
// contains the converted region as the entry computation.
Status ConvertRegionToComputation(mlir::Region* region,
::xla::XlaComputation* func,
MlirToHloConversionOptions options = {});
// Creates XlaOp equivalent of a given MLIR operation using the operand info
// from `value_lowering` map.
llvm::Optional<::xla::XlaOp> CreateXlaOperator(
mlir::Operation* op,
llvm::DenseMap<mlir::Value, ::xla::XlaOp>* value_lowering);
} // namespace mlir
#endif // TENSORFLOW_COMPILER_MLIR_XLA_MLIR_HLO_TO_HLO_H_
| {
"content_hash": "62b51c41dd69e0484f0d610a684f30a7",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 79,
"avg_line_length": 45.013333333333335,
"alnum_prop": 0.7236374407582938,
"repo_name": "gautam1858/tensorflow",
"id": "c781a739d1cac5b04a8c22e17c2e05b9f0d17a9d",
"size": "4044",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tensorflow/compiler/mlir/xla/mlir_hlo_to_hlo.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "47492"
},
{
"name": "C",
"bytes": "1129549"
},
{
"name": "C#",
"bytes": "13496"
},
{
"name": "C++",
"bytes": "116904214"
},
{
"name": "CMake",
"bytes": "165809"
},
{
"name": "Cython",
"bytes": "5003"
},
{
"name": "Dockerfile",
"bytes": "341994"
},
{
"name": "Go",
"bytes": "2052513"
},
{
"name": "HTML",
"bytes": "4686483"
},
{
"name": "Java",
"bytes": "1053827"
},
{
"name": "JavaScript",
"bytes": "5772"
},
{
"name": "Jupyter Notebook",
"bytes": "787371"
},
{
"name": "LLVM",
"bytes": "6536"
},
{
"name": "MLIR",
"bytes": "9549263"
},
{
"name": "Makefile",
"bytes": "2760"
},
{
"name": "Objective-C",
"bytes": "180638"
},
{
"name": "Objective-C++",
"bytes": "295149"
},
{
"name": "Pawn",
"bytes": "5336"
},
{
"name": "Perl",
"bytes": "7536"
},
{
"name": "Python",
"bytes": "43775271"
},
{
"name": "Roff",
"bytes": "5034"
},
{
"name": "Ruby",
"bytes": "7854"
},
{
"name": "Shell",
"bytes": "566970"
},
{
"name": "Smarty",
"bytes": "89664"
},
{
"name": "SourcePawn",
"bytes": "8509"
},
{
"name": "Starlark",
"bytes": "6897556"
},
{
"name": "Swift",
"bytes": "78435"
},
{
"name": "Vim Snippet",
"bytes": "58"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Tackling AS2 with JBoss Fuse</title>
<meta name="description" content="AS2, or Applicability Statement 2, is a specification which customers ask me about from time-to-time. It’s a protocol I’ve implemented in the past using bot...">
<link rel="stylesheet" href="/css/main.css">
<link rel="canonical" href="http://sigreen.github.io/2016/10/13/as2-fuse.html">
<link rel="alternate" type="application/rss+xml" title="Simon’s Blog" href="http://sigreen.github.io/feed.xml" />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link href='//fonts.googleapis.com/css?family=PT+Sans:400,700' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Open+Sans:300,700' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="site-header">
<nav class="site-nav">
<a class="page-link" href="/about/">About</a>
</nav>
<h1>
<span>
<a class="site-title" href="/">Simon’s Blog</a>
</span>
</h1>
</div>
<div class="page-content">
<div class="wrapper">
<div class="post">
<header class="post-header">
<h1 class="post-title">Tackling AS2 with JBoss Fuse</h1>
<p class="post-meta">Posted on Oct 13, 2016</p>
</header>
<article class="post-content">
<p>AS2, or Applicability Statement 2, is a specification which customers ask me about from time-to-time. It’s a protocol I’ve implemented in the past using both homegrown and proprietary EAI suite applications, and I was always impressed with the efficiency and ability of AS2 to implement guaranteed message delivery between B2B Trading Partner applications. It’s also nice that a calling application can request an Acknowledgement when sending a message, plus the option of encrypting the message and/or channel, and signing of the message for non-repudiation and authentication.</p>
<p>Essentially, AS2 is nothing more than an S/MIME message (or email) exchanged over HTTP(S). Sounds simple enough, but the underlying specification is where the real meat is. Let’s start with taking a look at a synchronous “fire and forget” AS2 message without a request for an Acknowledgement:</p>
<pre><code class="language-Text">AS2-Version:1.1
AS2-From:ABCCorp1
AS2-To:DEFCorp2
Date:Mon, 01 Oct 2007 12:39:55 CEST
Message-ID:<-61ce18ba:1155b26911a:-8000>
Subject:AS2 Message
X-VerifiedContentMIC:1234,sha1
disposition-notification-to: ABCCorp1
disposition-notification-options:signed-receipt-protocol=optional, pkcs7-signature;signed-receipt-micalg=optional, sha1
Content-Type:multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="----=_Part_0_1534588573.1191235195391"
User-Agent:Jakarta Commons-HttpClient/3.0.1
Host:10.53.1.46:10080
Content-Length:12121
URI:/b2b/as2/syncmdn
------=_Part_0_1534588573.1191235195391
Content-Type: text/plain; charset=ISO-8859-1; name=payload.txt
Content-Transfer-Encoding: binary
Content-Disposition: attachment; filename=payload.txt
111111111
111111111
111111111
111111111
------=_Part_0_1534588573.1191235195391
Content-Type: application/pkcs7-signature; name=smime.p7s; smime-type=signed-data
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature
D58aXhcU3LF8EV8zg2ExggGTMIIBjwIBATBXME8xCzAJBgNVBAYTAkVTMRIwEAYDVQQKEwlQYXJ0
MDcxMDAxMTAzOTU1WjAjBgkqhkiG9w0BCQQxFgQUXjgKuDVTY32GmtdMoZipz9K+DnIwNAYJKoZI
hvcNAQkPMScwJTAKBggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwBwYFKw4DAgcwDQYJKoZIhvcN
AQEBBQAEgYAz0qQekvfMDlbzzQJKCLkro6+70cvD8YQIftXU/v/x2xkK8HmtU7/TyMB1QH3+jQwl
paFeRrpZmuhP/HNagVoSwb7LIWBu8WvPuisLThRcsWnt6HdE0ZYltkjlSU2hsN/RSqfU+BuGSL1k
lmcA8AjzEGq7eioMKMh3SRbhJZpSQAAAAAAAAA==
------=_Part_0_1534588573.1191235195391--
</code></pre>
<p>The above message is really nothing more than an HTTP request message. You’ll notice the HTTP headers contain a few specific AS2 properties, the HTTP body in this case is unencrypted and there is a SHA1 digital signature to sign the unencrypted message. This scenario works great when you have an external B2B trading partner who needs to forward a notification message and doesn’t expect a reply. But what about guaranteed message delivery? What if the sending B2B partner would like to know when the message is received and processed by the receiving system? In this case, we introduce something called “Message Disposition Notification” or MDN. An MDN is just a wordy acknowledgement. We can request an MDN by specifying a “reply-to” address and “disposition-notification-options” like below:</p>
<p><img src="/images/as2_async.png" alt="Async AS2 Message" /></p>
<p>Now we have a way of (a)synchronously exchanging messages between Trading Partners, whilst guaranteeing message delivery without the need for a centralized broker. A sending Trading Partner has confirmation their message has been received, valid and processed via an MDN transmission. Take a look at the below synchronous reply:</p>
<p><img src="/images/as2_sync_invalid.png" alt="Sync MDN Message" /></p>
<p>You’ll notice an X-VerificationFailure:true header indicating the exchange could not be verified (probably because it cannot be authenticated). This is great news as the receiving AS2 server can verify the digital signature immediately using a Hardware Security Module (HSM) for realtime performance, without forwarding the “dodgy” message to the backend system. So effectively acting as a proxy.</p>
<p>Here’s an example asynchronous MDN message :</p>
<p><img src="/images/as2_mdn_async.png" alt="Async MDN Message" /></p>
<p>This MDN originates from the backend receiving system, telling the sender there was a problem during the processing of the message. But this is not a problem with the AS2 exchange - this was a problem with the business payload itself. Therefore, we now have guaranteed message delivery and status of business payload processing.</p>
<p>So there’s the semantics out of the way, what about Fuse? And what is so difficult about building this out using a fluent API like Camel with EIP building blocks? Let’s look a little closer at what’s required here:</p>
<ul>
<li>An HTTP server</li>
<li>A repository to store digital keys + certs (JKS or HSM)</li>
<li>A repository to store the state of AS2 exchanges (for duplicate checking and auditing)</li>
<li>A repository to store Trading Partner credentials (XML file or Database)</li>
</ul>
<p>Life would be easier if there was a Camel component to kickstart the AS2 flow, but unfortunately there isn’t. So let’s look at what options we have:</p>
<h3 id="openas2httpssourceforgenetprojectsopenas2"><a href="https://sourceforge.net/projects/openas2/">OpenAS2</a></h3>
<p>OpenAS2 is a java-based AS2 implementation. It is intended to be used as a server, configurable and supports a wide variety of signing and encryption algorithms. Features of OpenAS2 include:</p>
<ul>
<li>Conforms with AS2 1.1 protocol</li>
<li>Can run as a server daemon</li>
<li>Support for remote control</li>
<li>Configurable Signature and encryption</li>
<li>Supports compression</li>
<li>Configurable Synchronous and Asynchronous MDN</li>
<li>Supports HTTPS transport protocol</li>
<li>Supports filename preservation</li>
<li>Supports FDA Automatic Submissions Gateway using custom headers</li>
<li>Supports easy extending and adding of new modules via XML configuration</li>
</ul>
<p>Projects like OpenAS2 are great news, as they’re portable to Java-based applications like JBoss Fuse. There are some challenges we need to overcome though, including:</p>
<ul>
<li>No support for OSGi containers</li>
<li>Trading Partner information (credentials, keys, certs) are all managed via a large XML file. Not ideal if you have hundreds or even thousands of Trading Partner credentials to maintain</li>
<li>Inflexible database support - H2 only</li>
</ul>
<p>OpenAS2 is great start for what we’re trying to achieve, but we need to look further afield.</p>
<h3 id="as2-serverhttpsgithubcomphaxas2-server"><a href="https://github.com/phax/as2-server">as2-server</a></h3>
<p>Luckily, there’s another project which further extends OpenAS2. It’s called as2-server / as2-lib and can be found <a href="https://github.com/phax/as2-server">here</a>. The advantage of this project is:</p>
<ul>
<li>Maven support</li>
<li>Some OSGi support</li>
<li>Replaces H2 database with MongoDB</li>
</ul>
<p>This project could easily be ported to run in Karaf, and potentially extended to offer Trading Partner profile storage on Mongo or some other relational database. Hopefully in the future we might see a Camel component appear that takes all the goodness from these projects and provides a flexible, extensible and maintainable AS2 solution that we can use in the field.</p>
</article>
<div align="center">
<a href="#">
<i class="fa fa-arrow-circle-up fa-2x"></i>
</a>
</div>
</div>
</div>
<div class="wrapper">
<!-- Add Disqus comments. -->
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'sigreen'; // required: replace example with your forum shortname
var disqus_identifier = "/2016/10/13/as2-fuse.html";
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
</div>
<div class="footer" align="center">
Designed by <a href=http://diezcami.github.io target="_blank">Camille Diez</a><BR />
Powered by <a href=http://jekyllrb.com target="_blank">Jekyll</a>
</div>
</body>
</html>
| {
"content_hash": "1135cd3feb0c1d2684e5f4261f11cb86",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 809,
"avg_line_length": 48.85581395348837,
"alnum_prop": 0.7404798172124905,
"repo_name": "sigreen/sigreen.github.io",
"id": "5cbf951869aad0f04afc4c1aab107800c1cf39c0",
"size": "10566",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_site/2016/10/13/as2-fuse.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "25153"
},
{
"name": "HTML",
"bytes": "62614"
},
{
"name": "Ruby",
"bytes": "6548"
}
],
"symlink_target": ""
} |
layout: project
source: https://github.com/zanshi/transcension3d
title: Transcension 3D
subtitle:
visible: true
tags:
- C++
- OpenGL
- Rendering
- Computer Graphics
---
We made a game engine in C++ and OpenGl with integrated support for the Bullet physics engine and dynamic level loading. I worked on the overall architecture of the engine and also helped integrate Bullet into the engine. | {
"content_hash": "4febfe70040492decd964ccd579c690b",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 221,
"avg_line_length": 29.214285714285715,
"alnum_prop": 0.7506112469437652,
"repo_name": "zanshi/zanshi.github.io",
"id": "6921a411b4b86f7cfbd4163c214146b369bc4e9d",
"size": "413",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_projects/transcension.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "20444"
},
{
"name": "HTML",
"bytes": "33532"
},
{
"name": "JavaScript",
"bytes": "4356"
},
{
"name": "Ruby",
"bytes": "4811"
}
],
"symlink_target": ""
} |
using Newtonsoft.Json.Linq;
using System;
using System.Linq;
using System.Collections.Generic;
namespace Net.Moloni.Model
{
public class ProductInfo : BaseResource
{
public int Id { get; set; }
public ProductType Type { get; set; }
public string Name { get; set; }
public string Reference { get; set; }
public string EAN { get; set; }
public double Price { get; set; }
public double Stock { get; set; }
public AtProductCategory AtProductCategory { get; set; }
public string Image { get; set; }
public MeasurementUnitInfo MeasurementUnit { get; set; }
public IEnumerable<ProductTaxInfo> ProductTaxes { get; private set; }
internal ProductInfo(JToken jToken) : base(jToken)
{
this.Id = jToken.Value<int>("product_id");
this.Type = (ProductType)jToken.Value<int>("type");
this.Name = jToken.Value<string>("name");
this.Reference = jToken.Value<string>("reference");
this.EAN = jToken.Value<string>("ean");
this.Price = jToken.Value<double>("price");
this.Stock = jToken.Value<double>("stock");
this.MeasurementUnit = new MeasurementUnitInfo(jToken.Value<JToken>("measurement_unit"));
this.ProductTaxes = jToken.Value<JArray>("taxes").Select(t => new ProductTaxInfo(t));
this.Image = jToken.Value<string>("image");
var atProductCategoryVal = jToken.Value<string>("at_product_category");
this.AtProductCategory = ((!string.IsNullOrEmpty(atProductCategoryVal)))
? (AtProductCategory)Enum.Parse(typeof(AtProductCategory), atProductCategoryVal)
: AtProductCategory.NotApplicable;
}
}
public enum ProductType
{
Product = 1,
Service = 2,
Other = 3
}
public enum AtProductCategory
{
NotApplicable = 0,
/// <summary>
/// Goods
/// </summary>
M,
/// <summary>
/// Raw Materials, Subsidiaries and Consumer Goods
/// </summary>
P,
/// <summary>
/// Finished and Intermediate Products
/// </summary>
A,
/// <summary>
/// By-products, Waste and Scrap
/// </summary>
S,
/// <summary>
/// Products and Work in Progress
/// </summary>
T
}
}
| {
"content_hash": "388d26f26134bebbe7804bb7ef661c3a",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 101,
"avg_line_length": 29.55421686746988,
"alnum_prop": 0.569099062372605,
"repo_name": "lusocoding/net.moloni",
"id": "2593928acc9ef5baa1201a5eb37b7275fce2d4c8",
"size": "2455",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Lusocoding.Net.Moloni/Model/EntitiesInfo/ProductInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "93074"
}
],
"symlink_target": ""
} |
using System;
using System.Diagnostics;
using System.Linq.Expressions;
using Vita.Data.Model;
using Vita.Entities;
using Vita.Entities.Locking;
namespace Vita.Data.Linq.Translation.Expressions {
/// <summary>
/// A table is a default table, or a joined table
/// Different joins specify different tables
/// </summary>
[DebuggerDisplay("TableExpression {Name} (as {Alias})")]
public class TableExpression : SqlExpression {
// Table idenfitication
public string Name { get; private set; }
public DbTableInfo TableInfo;
public LockType LockType;
public int SortIndex;
// Join: if this table is related to another, the following informations are filled
public Expression JoinExpression { get; private set; } // full information is here, ReferencedTable and Join could be (in theory) extracted from this
public TableJoinType JoinType { get; private set; }
public string JoinID { get; private set; }
public TableExpression JoinedTable { get; private set; }
public TableExpression(DbTableInfo tableInfo, LockType lockType = LockType.None, string joinId = null)
: this(tableInfo, tableInfo.Entity.EntityType, tableInfo.FullName, lockType, joinId) { }
public TableExpression(DbTableInfo tableInfo, Type type, string name, LockType lockType = LockType.None, string joinId = null)
: base(SqlExpressionType.Table, type) {
Util.Check(type != null, "TableExpression (name: {0}) - type may not be null.", name);
TableInfo = tableInfo;
Name = name;
LockType = lockType;
JoinID = joinId;
}
public void Join(TableJoinType joinType, Expression joinedTbl, Expression joinExpression) {
//RI: special case - inner joins on top of outer joins should become outer joins as well
var joinedTable = joinedTbl as TableExpression;
if (joinedTable == null)
Util.Check(false, "Joins with subqueries not supported, joined expr: {0}", joinedTbl);
if(joinedTable != null && joinedTable.JoinedTable != null && (joinedTable.JoinType & TableJoinType.FullOuter) != 0)
joinType |= joinedTable.JoinType;
JoinExpression = joinExpression;
JoinType = joinType;
JoinedTable = joinedTable;
}
public void Join(TableJoinType joinType, TableExpression joinedTable, Expression joinExpression, string joinID) {
Join(joinType, joinedTable, joinExpression);
JoinID = joinID;
}
/// <summary>
/// Set the table outer join, depending on the current table location
/// Result can set the table to be left outer join or right outer join
/// </summary>
public void SetOuterJoin() {
// JoinExpression is non-null for associated table
if(JoinExpression != null)
JoinType |= TableJoinType.LeftOuter;
else
JoinType |= TableJoinType.RightOuter;
}
public virtual bool IsEqualTo(TableExpression table) {
return Name == table.Name && JoinID == table.JoinID && this.Alias == table.Alias; //RI: added Alias comparison
}
}
} | {
"content_hash": "77e71d62bc6fe6b816d47269071b68de",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 153,
"avg_line_length": 41.0945945945946,
"alnum_prop": 0.6977967773758632,
"repo_name": "rivantsov/vita",
"id": "4cfe7c82dfdfcbc717418109ae49a60418bc061d",
"size": "3042",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/1.Framework/Vita/4.Internals/Data/Linq/Translation/Expressions/TableExpression.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "3163"
},
{
"name": "C#",
"bytes": "2140470"
}
],
"symlink_target": ""
} |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.prestosql.plugin.jdbc;
import com.google.common.collect.ImmutableSet;
import io.airlift.bootstrap.LifeCycleManager;
import io.prestosql.spi.connector.Connector;
import io.prestosql.spi.connector.ConnectorAccessControl;
import io.prestosql.spi.connector.ConnectorCapabilities;
import io.prestosql.spi.connector.ConnectorMetadata;
import io.prestosql.spi.connector.ConnectorPageSinkProvider;
import io.prestosql.spi.connector.ConnectorRecordSetProvider;
import io.prestosql.spi.connector.ConnectorSplitManager;
import io.prestosql.spi.connector.ConnectorTransactionHandle;
import io.prestosql.spi.procedure.Procedure;
import io.prestosql.spi.session.PropertyMetadata;
import io.prestosql.spi.transaction.IsolationLevel;
import javax.inject.Inject;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.collect.Sets.immutableEnumSet;
import static io.prestosql.spi.connector.ConnectorCapabilities.NOT_NULL_COLUMN_CONSTRAINT;
import static io.prestosql.spi.transaction.IsolationLevel.READ_COMMITTED;
import static io.prestosql.spi.transaction.IsolationLevel.checkConnectorSupports;
import static java.util.Objects.requireNonNull;
public class JdbcConnector
implements Connector
{
private final LifeCycleManager lifeCycleManager;
private final JdbcMetadataFactory jdbcMetadataFactory;
private final ConnectorSplitManager jdbcSplitManager;
private final ConnectorRecordSetProvider jdbcRecordSetProvider;
private final ConnectorPageSinkProvider jdbcPageSinkProvider;
private final Optional<ConnectorAccessControl> accessControl;
private final Set<Procedure> procedures;
private final List<PropertyMetadata<?>> sessionProperties;
private final ConcurrentMap<ConnectorTransactionHandle, JdbcMetadata> transactions = new ConcurrentHashMap<>();
@Inject
public JdbcConnector(
LifeCycleManager lifeCycleManager,
JdbcMetadataFactory jdbcMetadataFactory,
ConnectorSplitManager jdbcSplitManager,
ConnectorRecordSetProvider jdbcRecordSetProvider,
ConnectorPageSinkProvider jdbcPageSinkProvider,
Optional<ConnectorAccessControl> accessControl,
Set<Procedure> procedures,
Set<SessionPropertiesProvider> sessionProperties)
{
this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null");
this.jdbcMetadataFactory = requireNonNull(jdbcMetadataFactory, "jdbcMetadataFactory is null");
this.jdbcSplitManager = requireNonNull(jdbcSplitManager, "jdbcSplitManager is null");
this.jdbcRecordSetProvider = requireNonNull(jdbcRecordSetProvider, "jdbcRecordSetProvider is null");
this.jdbcPageSinkProvider = requireNonNull(jdbcPageSinkProvider, "jdbcPageSinkProvider is null");
this.accessControl = requireNonNull(accessControl, "accessControl is null");
this.procedures = ImmutableSet.copyOf(requireNonNull(procedures, "procedures is null"));
this.sessionProperties = requireNonNull(sessionProperties, "sessionProperties is null").stream()
.flatMap(sessionPropertiesProvider -> sessionPropertiesProvider.getSessionProperties().stream())
.collect(toImmutableList());
}
@Override
public boolean isSingleStatementWritesOnly()
{
return true;
}
@Override
public ConnectorTransactionHandle beginTransaction(IsolationLevel isolationLevel, boolean readOnly)
{
checkConnectorSupports(READ_COMMITTED, isolationLevel);
JdbcTransactionHandle transaction = new JdbcTransactionHandle();
transactions.put(transaction, jdbcMetadataFactory.create());
return transaction;
}
@Override
public ConnectorMetadata getMetadata(ConnectorTransactionHandle transaction)
{
JdbcMetadata metadata = transactions.get(transaction);
checkArgument(metadata != null, "no such transaction: %s", transaction);
return metadata;
}
@Override
public void commit(ConnectorTransactionHandle transaction)
{
checkArgument(transactions.remove(transaction) != null, "no such transaction: %s", transaction);
}
@Override
public void rollback(ConnectorTransactionHandle transaction)
{
JdbcMetadata metadata = transactions.remove(transaction);
checkArgument(metadata != null, "no such transaction: %s", transaction);
metadata.rollback();
}
@Override
public ConnectorSplitManager getSplitManager()
{
return jdbcSplitManager;
}
@Override
public ConnectorRecordSetProvider getRecordSetProvider()
{
return jdbcRecordSetProvider;
}
@Override
public ConnectorPageSinkProvider getPageSinkProvider()
{
return jdbcPageSinkProvider;
}
@Override
public ConnectorAccessControl getAccessControl()
{
return accessControl.orElseThrow(UnsupportedOperationException::new);
}
@Override
public Set<Procedure> getProcedures()
{
return procedures;
}
@Override
public List<PropertyMetadata<?>> getSessionProperties()
{
return sessionProperties;
}
@Override
public final void shutdown()
{
lifeCycleManager.stop();
}
@Override
public Set<ConnectorCapabilities> getCapabilities()
{
return immutableEnumSet(NOT_NULL_COLUMN_CONSTRAINT);
}
}
| {
"content_hash": "33fb2af8081db6ac5c78d846ed17d68f",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 115,
"avg_line_length": 37.40718562874252,
"alnum_prop": 0.7526812870177685,
"repo_name": "hgschmie/presto",
"id": "6324bf190aab122c1ccc11cc09aa35c0915a7a21",
"size": "6247",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "presto-base-jdbc/src/main/java/io/prestosql/plugin/jdbc/JdbcConnector.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "28776"
},
{
"name": "CSS",
"bytes": "13019"
},
{
"name": "Dockerfile",
"bytes": "1328"
},
{
"name": "HTML",
"bytes": "28633"
},
{
"name": "Java",
"bytes": "33806380"
},
{
"name": "JavaScript",
"bytes": "217040"
},
{
"name": "Makefile",
"bytes": "6830"
},
{
"name": "PLSQL",
"bytes": "2990"
},
{
"name": "Python",
"bytes": "10747"
},
{
"name": "SQLPL",
"bytes": "926"
},
{
"name": "Shell",
"bytes": "34068"
},
{
"name": "TSQL",
"bytes": "162799"
},
{
"name": "Thrift",
"bytes": "12631"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Real-time metrics through MQTT</title>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<table class="table">
<tr>
<td>Mode</td>
<td></td>
<td id="mode_value" class="text-info">Unknown</td>
</tr>
<tr>
<td style="vertical-align: middle">Steering</td>
<td><canvas id="chart_steering_div" width="600" height="100"></canvas></td>
<td id="steering_value" style="vertical-align: middle" class="text-info">0</td>
</tr>
<tr>
<td style="vertical-align: middle">Throttle</td>
<td><canvas id="chart_throttle_div" width="600" height="100"></canvas></td>
<td id="throttle_value" style="vertical-align: middle" class="text-info">0</td>
</tr>
<tr>
<td style="vertical-align: middle">FPS</td>
<td><canvas id="chart_fps_div" width="600" height="100"></canvas></td>
<td id="fps_value" style="vertical-align: middle" class="text-info">0</td>
</tr>
<tr>
<td style="vertical-align: middle">Accelerometer X/Y/Z</td>
<td>
<canvas id="chart_acc_x_div" width="200" height="100"></canvas>
<canvas id="chart_acc_y_div" width="200" height="100"></canvas>
<canvas id="chart_acc_z_div" width="200" height="100"></canvas>
</td>
<td id="acc_value" style="vertical-align: middle" class="text-info">0</td>
</tr>
<tr>
<td style="vertical-align: middle">Number of markers detected</td>
<td><canvas id="chart_nb_markers_div" width="600" height="100"></canvas></td>
<td id="nb_markers_value" style="vertical-align: middle" class="text-info">0</td>
</tr>
<tr>
<td style="vertical-align: middle">Distance to the closest marker</td>
<td><canvas id="chart_closest_div" width="600" height="100"></canvas></td>
<td id="closest_value" style="vertical-align: middle" class="text-info">0</td>
</tr>
<tr>
<td style="vertical-align: middle">Number of clients</td>
<td id="nbClient" style="vertical-align: middle" class="text-info">0</td>
</tr>
<tr>
<canvas id="myCanvas" width="640" height="480"
style="border:1px solid #000000">
</canvas>
<input type="submit" id="envoi_message" value="STOP" />
</tr>
</table>
</div>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost:1337');
console.log('VROOOOOOOOOOOMWAAAAAAAAAAZZZZZ');
function getMinOfArray(numArray) {
return Math.min.apply(null, numArray);
}
function getMaxOfArray(numArray) {
return Math.max.apply(null, numArray);
}
function deleteOldValues(labels, data, limit) {
if (data.length > limit) {
labels.shift();
data.shift();
}
}
function displayChart(context, labels, data, minEqMax, max) {
var options;
if (minEqMax) {
options = {
scaleOverride: true,
scaleSteps: 3,
scaleStepWidth: 1,
scaleStartValue: max - 2,
datasetFill: false,
animation: false
};
} else {
options = {
datasetFill: false,
animation: false
};
}
//var c = new Chart(context);
/*c.Line({
labels: labels,
datasets: [{
data: data
}]
}, options);
*/
}
<!-- nb_client-->
socket.on('new_client', function (nb) {
document.getElementById('nbClient').innerHTML = nb;
});
socket.on('disconnection', function (nb) {
document.getElementById('nbClient').innerHTML = nb;
});
<!-- Mode -->
socket.on('Mode', function(data) {
document.getElementById('mode_value').innerHTML = data.value;
});
<!-- Steering -->
var ctxSteering = document.getElementById('chart_steering_div').getContext('2d');
var arrayLabelsSteering = new Array();
var arrayDataSteering = new Array();
socket.on('Steering', function(data) {
console.log('VROOOOOOOOOOOM');
console.log(data.toString());
document.getElementById('steering_value').innerHTML = data.value;
arrayLabelsSteering.push(data.time);
arrayDataSteering.push(data.value);
var min = getMinOfArray(arrayDataSteering);
var max = getMaxOfArray(arrayDataSteering);
deleteOldValues(arrayLabelsSteering, arrayDataSteering, 20);
displayChart(ctxSteering, arrayLabelsSteering, arrayDataSteering,
min==max, max);
});
<!-- Throttle -->
var ctxThrottle = document.getElementById('chart_throttle_div').getContext('2d');
var arrayLabelsThrottle = new Array();
var arrayDataThrottle = new Array();
socket.on('Throttle', function(data) {
console.log(data.toString());
document.getElementById('throttle_value').innerHTML = data.value;
arrayLabelsThrottle.push(data.time);
arrayDataThrottle.push(data.value);
var min = getMinOfArray(arrayDataThrottle);
var max = getMaxOfArray(arrayDataThrottle);
deleteOldValues(arrayLabelsThrottle, arrayDataThrottle, 20);
displayChart(ctxThrottle, arrayLabelsThrottle, arrayDataThrottle,
min==max, max);
});
<!-- FPS -->
var ctxFPS = document.getElementById('chart_fps_div').getContext('2d');
var arrayLabelsFPS = new Array();
var arrayDataFPS = new Array();
socket.on('FPS', function(data) {
document.getElementById('fps_value').innerHTML = data.value.toFixed(2);
arrayLabelsFPS.push(data.time);
arrayDataFPS.push(data.value);
var min = getMinOfArray(arrayDataFPS);
var max = getMaxOfArray(arrayDataFPS);
deleteOldValues(arrayLabelsFPS, arrayDataFPS, 20);
displayChart(ctxFPS, arrayLabelsFPS, arrayDataFPS,
min==max, max);
});
<!-- Accelerometer -->
var ctxAccX = document.getElementById('chart_acc_x_div').getContext('2d');
var ctxAccY = document.getElementById('chart_acc_y_div').getContext('2d');
var ctxAccZ = document.getElementById('chart_acc_z_div').getContext('2d');
var arrayLabelsAcc = new Array();
var arrayDataAccX = new Array();
var arrayDataAccY = new Array();
var arrayDataAccZ = new Array();
socket.on('Accelerometer', function(data) {
document.getElementById('acc_value').innerHTML = "x : " + data.x + " - y: " + data.y + " - z: " + data.z;
arrayLabelsAcc.push(data.time);
arrayDataAccX.push(data.x);
arrayDataAccY.push(data.y);
arrayDataAccZ.push(data.z);
var minX = getMinOfArray(arrayDataAccX);
var maxX = getMaxOfArray(arrayDataAccX);
var minY = getMinOfArray(arrayDataAccY);
var maxY = getMaxOfArray(arrayDataAccY);
var minZ = getMinOfArray(arrayDataAccZ);
var maxZ = getMaxOfArray(arrayDataAccZ);
deleteOldValues(arrayLabelsAcc, arrayDataAccX, 8);
deleteOldValues(arrayDataAccY, arrayDataAccZ, 8);
displayChart(ctxAccX, arrayLabelsAcc, arrayDataAccX,
minX==maxX, maxX);
displayChart(ctxAccY, arrayLabelsAcc, arrayDataAccY,
minY==maxY, maxY);
displayChart(ctxAccZ, arrayLabelsAcc, arrayDataAccZ,
minZ==maxZ, maxZ);
});
<!-- Nb Marker -->
var ctxNbMarkers = document.getElementById('chart_nb_markers_div').getContext('2d');
var arrayLabelsNbMarkers = new Array();
var arrayDataNbMarkers = new Array();
socket.on('NbMarkers', function(data) {
document.getElementById('nb_markers_value').innerHTML = data.value;
arrayLabelsNbMarkers.push(data.time);
arrayDataNbMarkers.push(data.value);
var min = getMinOfArray(arrayDataNbMarkers);
var max = getMaxOfArray(arrayDataNbMarkers);
deleteOldValues(arrayLabelsNbMarkers, arrayDataNbMarkers, 20);
displayChart(ctxNbMarkers, arrayLabelsNbMarkers, arrayDataNbMarkers,
min==max, max);
});
<!-- Closest -->
var ctxClosest = document.getElementById('chart_closest_div').getContext('2d');
var arrayLabelsClosest = new Array();
var arrayDataClosest = new Array();
socket.on('Closest', function(data) {
document.getElementById('closest_value').innerHTML = data.value;
arrayLabelsClosest.push(data.time);
arrayDataClosest.push(data.value);
var min = getMinOfArray(arrayDataClosest);
var max = getMaxOfArray(arrayDataClosest);
deleteOldValues(arrayLabelsClosest, arrayDataClosest, 20);
displayChart(ctxClosest, arrayLabelsClosest, arrayDataClosest,
min==max, max);
});
<!-- Images -->
var ctx = document.getElementById('myCanvas').getContext('2d');
socket.on("image", function(info) {
console.log('Info recu');
if (info.image) {
var img = new Image();
img.src = 'data:image/jpeg;base64,' + info.buffer;
ctx.drawImage(img, 0, 0);
}
});
// Lorsqu'on envoie un signal pour stopper la camera
document.getElementById("envoi_message").addEventListener("click",function() {
console.log("STOPPING THE CAMERA");
socket.emit('camera/commands', { value: "stop" }); // Transmet le message aux autres
},
true);
</script>
</body>
</html>
| {
"content_hash": "75b4cc6c8195fa4d77d5b434743b7d0d",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 121,
"avg_line_length": 42.901185770750985,
"alnum_prop": 0.5441311958724894,
"repo_name": "malek0512/2014_2015_ricm4_cannon_ball",
"id": "091b5008cb65554ea158cc733cd1ac21fb41ad25",
"size": "10854",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Mosquitto/subscriber/view.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Arduino",
"bytes": "6371"
},
{
"name": "Assembly",
"bytes": "2667"
},
{
"name": "C",
"bytes": "2551365"
},
{
"name": "C++",
"bytes": "4716697"
},
{
"name": "CMake",
"bytes": "88136"
},
{
"name": "D",
"bytes": "10941"
},
{
"name": "HTML",
"bytes": "224877"
},
{
"name": "Java",
"bytes": "14645"
},
{
"name": "JavaScript",
"bytes": "6148"
},
{
"name": "Makefile",
"bytes": "16410"
},
{
"name": "Objective-C",
"bytes": "5343"
},
{
"name": "Python",
"bytes": "84244"
},
{
"name": "Shell",
"bytes": "4549"
}
],
"symlink_target": ""
} |
<?php
/****************************************************************/
/* ATutor */
/****************************************************************/
/* Copyright (c) 2002-2009 */
/* Inclusive Design Institute */
/* http://atutor.ca */
/* */
/* This program is free software. You can redistribute it and/or*/
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation. */
/****************************************************************/
// $Id$
$_user_location = 'public';
define('AT_INCLUDE_PATH', '../../../../include/');
require(AT_INCLUDE_PATH.'vitals.inc.php');
require(AT_SOCIAL_INCLUDE.'constants.inc.php');
require(AT_SOCIAL_INCLUDE.'friends.inc.php');
require(AT_SOCIAL_INCLUDE.'classes/SocialGroups/SocialGroup.class.php');
require(AT_SOCIAL_INCLUDE.'classes/SocialGroups/SocialGroups.class.php');
// Get social group class
$social_groups = new SocialGroups();
// Get this group
$id = intval($_REQUEST['id']); //make sure $_GET and $_POST don't overlap the use of 'id'
$sg = new SocialGroup($id);
$sgs = new SocialGroups();
//validate if this user is the administrator of the group
if ($sg->getUser() != $_SESSION['member_id']){
$msg->addError('CANT_DELETE_GROUP');
header('Location: index.php');
exit;
}
//delete group
$msg->addFeedback('GROUP_DELETED');
$sgs->removeGroup($id);
header('Location: '.url_rewrite(AT_SOCIAL_BASENAME.'groups/index.php', AT_PRETTY_URL_HEADER));
exit;
//Display
/*
include(AT_INCLUDE_PATH.'header.inc.php');
$savant->assign('group_obj', $group);
$savant->assign('group_types', $social_groups->getAllGroupType());
$savant->display('sgroup_edit.tmpl.php');
include(AT_INCLUDE_PATH.'footer.inc.php');
*/
?> | {
"content_hash": "54b13eab37b03918dd8cb35588c435ba",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 94,
"avg_line_length": 34.83018867924528,
"alnum_prop": 0.5677139761646804,
"repo_name": "CaviereFabien/Test",
"id": "6666ae3cafda4229dbddd9e120c9c31383729dae",
"size": "1846",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ATutor/new_mods/_standard/social/groups/delete.php",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.scalactic
import scala.collection.immutable
import scala.collection.mutable.ArrayBuffer
import scala.collection.GenTraversableOnce
import scala.reflect.ClassTag
import scala.collection.mutable.Buffer
import scala.collection.GenSeq
import scala.collection.GenIterable
import scala.collection.generic.CanBuildFrom
import scala.annotation.unchecked.{ uncheckedVariance => uV }
// Can't be a LinearSeq[T] because Builder would be able to create an empty one.
/**
* A non-empty list: an ordered, immutable, non-empty collection of elements with <code>LinearSeq</code> performance characteristics.
*
* <p>
* The purpose of <code>Chain</code> is to allow you to express in a type that a <code>List</code> is non-empty, thereby eliminating the
* need for (and potential exception from) a run-time check for non-emptiness. For a non-empty sequence with <code>IndexedSeq</code>
* performance, see <a href="Every.html"><code>Every</code></a>.
* </p>
*
* <h2>Constructing <code>Chain</code>s</h2>
*
* <p>
* You can construct a <code>Chain</code> by passing one or more elements to the <code>Chain.apply</code> factory method:
* </p>
*
* <pre class="stHighlight">
* scala> Chain(1, 2, 3)
* res0: org.scalactic.Chain[Int] = Chain(1, 2, 3)
* </pre>
*
* <p>
* Alternatively you can <em>cons</em> elements onto the <code>End</code> singleton object, similar to making a <code>List</code> starting with <code>Nil</code>:
* </p>
*
* <pre class="stHighlight">
* scala> 1 :: 2 :: 3 :: Nil
* res0: List[Int] = List(1, 2, 3)
*
* scala> 1 :: 2 :: 3 :: End
* res1: org.scalactic.Chain[Int] = Chain(1, 2, 3)
* </pre>
*
* <p>
* Note that although <code>Nil</code> is a <code>List[Nothing]</code>, <code>End</code> is
* not a <code>Chain[Nothing]</code>, because no empty <code>Chain</code> exists. (A chain is a series
* of connected links; if you have no links, you have no chain.)
* </p>
*
* <pre class="stHighlight">
* scala> val nil: List[Nothing] = Nil
* nil: List[Nothing] = List()
*
* scala> val nada: Chain[Nothing] = End
* <console>:16: error: type mismatch;
* found : org.scalactic.End.type
* required: org.scalactic.Chain[Nothing]
* val nada: Chain[Nothing] = End
* ^
* </pre>
*
* <h2>Working with <code>Chain</code>s</h2>
*
* <p>
* <code>Chain</code> does not extend Scala's <code>Seq</code> or <code>Traversable</code> traits because these require that
* implementations may be empty. For example, if you invoke <code>tail</code> on a <code>Seq</code> that contains just one element,
* you'll get an empty <code>Seq</code>:
* </p>
*
* <pre class="stREPL">
* scala> List(1).tail
* res6: List[Int] = List()
* </pre>
*
* <p>
* On the other hand, many useful methods exist on <code>Seq</code> that when invoked on a non-empty <code>Seq</code> are guaranteed
* to not result in an empty <code>Seq</code>. For convenience, <code>Chain</code> defines a method corresponding to every such <code>Seq</code>
* method. Here are some examples:
* </p>
*
* <pre class="stHighlight">
* Chain(1, 2, 3).map(_ + 1) // Result: Chain(2, 3, 4)
* Chain(1).map(_ + 1) // Result: Chain(2)
* Chain(1, 2, 3).containsSlice(Chain(2, 3)) // Result: true
* Chain(1, 2, 3).containsSlice(Chain(3, 4)) // Result: false
* Chain(-1, -2, 3, 4, 5).minBy(_.abs) // Result: -1
* </pre>
*
* <p>
* <code>Chain</code> does <em>not</em> currently define any methods corresponding to <code>Seq</code> methods that could result in
* an empty <code>Seq</code>. However, an implicit converison from <code>Chain</code> to <code>List</code>
* is defined in the <code>Chain</code> companion object that will be applied if you attempt to call one of the missing methods. As a
* result, you can invoke <code>filter</code> on an <code>Chain</code>, even though <code>filter</code> could result
* in an empty sequence—but the result type will be <code>List</code> instead of <code>Chain</code>:
* </p>
*
* <pre class="stHighlight">
* Chain(1, 2, 3).filter(_ < 10) // Result: List(1, 2, 3)
* Chain(1, 2, 3).filter(_ > 10) // Result: List()
* </pre>
*
*
* <p>
* You can use <code>Chain</code>s in <code>for</code> expressions. The result will be an <code>Chain</code> unless
* you use a filter (an <code>if</code> clause). Because filters are desugared to invocations of <code>filter</code>, the
* result type will switch to a <code>List</code> at that point. Here are some examples:
* </p>
*
* <pre class="stREPL">
* scala> import org.scalactic._
* import org.scalactic._
*
* scala> for (i <- Chain(1, 2, 3)) yield i + 1
* res0: org.scalactic.Chain[Int] = Chain(2, 3, 4)
*
* scala> for (i <- Chain(1, 2, 3) if i < 10) yield i + 1
* res1: List[Int] = List(2, 3, 4)
*
* scala> for {
* | i <- Chain(1, 2, 3)
* | j <- Chain('a', 'b', 'c')
* | } yield (i, j)
* res3: org.scalactic.Chain[(Int, Char)] =
* Chain((1,a), (1,b), (1,c), (2,a), (2,b), (2,c), (3,a), (3,b), (3,c))
*
* scala> for {
* | i <- Chain(1, 2, 3) if i < 10
* | j <- Chain('a', 'b', 'c')
* | } yield (i, j)
* res6: List[(Int, Char)] =
* List((1,a), (1,b), (1,c), (2,a), (2,b), (2,c), (3,a), (3,b), (3,c))
* </pre>
*
* @tparam T the type of elements contained in this <code>Chain</code>
*/
final class Chain[+T] private (underlying: List[T]) extends PartialFunction[Int, T] {
/**
* Returns a new <code>Chain</code> containing the elements of this <code>Chain</code> followed by the elements of the passed <code>Chain</code>.
* The element type of the resulting <code>Chain</code> is the most specific superclass encompassing the element types of this and the passed <code>Chain</code>.
*
* @tparam U the element type of the returned <code>Chain</code>
* @param other the <code>Chain</code> to append
* @return a new <code>Chain</code> that contains all the elements of this <code>Chain</code> followed by all elements of <code>other</code>.
*/
def ++[U >: T](other: Chain[U]): Chain[U] = new Chain(underlying ++ other.toList)
/**
* Returns a new <code>Chain</code> containing the elements of this <code>Chain</code> followed by the elements of the passed <code>Every</code>.
* The element type of the resulting <code>Chain</code> is the most specific superclass encompassing the element types of this <code>Chain</code> and the passed <code>Every</code>.
*
* @tparam U the element type of the returned <code>Chain</code>
* @param other the <code>Every</code> to append
* @return a new <code>Chain</code> that contains all the elements of this <code>Chain</code> followed by all elements of <code>other</code>.
*/
def ++[U >: T](other: Every[U]): Chain[U] = new Chain(underlying ++ other.toVector)
// TODO: Have I added these extra ++, etc. methods to Every that take a Chain?
/**
* Returns a new <code>Chain</code> containing the elements of this <code>Chain</code> followed by the elements of the passed <code>GenTraversableOnce</code>.
* The element type of the resulting <code>Chain</code> is the most specific superclass encompassing the element types of this <code>Chain</code>
* and the passed <code>GenTraversableOnce</code>.
*
* @tparam U the element type of the returned <code>Chain</code>
* @param other the <code>GenTraversableOnce</code> to append
* @return a new <code>Chain</code> that contains all the elements of this <code>Chain</code> followed by all elements of <code>other</code>.
*/
def ++[U >: T](other: GenTraversableOnce[U]): Chain[U] =
if (other.isEmpty) this else new Chain(underlying ++ other)
/**
* Fold left: applies a binary operator to a start value, <code>z</code>, and all elements of this <code>Chain</code>, going left to right.
*
* <p>
* Note: <code>/:</code> is alternate syntax for the <code>foldLeft</code> method; <code>z</code> <code>/:</code> <code>chain</code> is the
* same as <code>chain</code> <code>foldLeft</code> <code>z</code>.
* </p>
*
* @tparam B the result of the binary operator
* @param z the start value
* @param op the binary operator
* @return the result of inserting <code>op</code> between consecutive elements of this <code>Chain</code>, going left to right, with the start value,
* <code>z</code>, on the left:
*
* <pre>
* op(...op(op(z, x_1), x_2), ..., x_n)
* </pre>
*
* <p>
* where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>Chain</code>.
* </p>
*/
final def /:[B](z: B)(op: (B, T) => B): B = underlying./:(z)(op)
/**
* Fold right: applies a binary operator to all elements of this <code>Chain</code> and a start value, going right to left.
*
* <p>
* Note: <code>:\</code> is alternate syntax for the <code>foldRight</code> method; <code>chain</code> <code>:\</code> <code>z</code> is the same
* as <code>chain</code> <code>foldRight</code> <code>z</code>.
* </p>
*
* @tparam B the result of the binary operator
* @param z the start value
* @param op the binary operator
* @return the result of inserting <code>op</code> between consecutive elements of this <code>Chain</code>, going right to left, with the start value,
* <code>z</code>, on the right:
*
* <pre>
* op(x_1, op(x_2, ... op(x_n, z)...))
* </pre>
*
* <p>
* where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>Chain</code>.
* </p>
*/
final def :\[B](z: B)(op: (T, B) => B): B = underlying.:\(z)(op)
/**
* Returns a new <code>Chain</code> with the given element prepended.
*
* <p>
* Note that :-ending operators are right associative. A mnemonic for <code>+:</code> <em>vs.</em> <code>:+</code> is: the COLon goes on the COLlection side.
* </p>
*
* @param element the element to prepend to this <code>Chain</code>
* @return a new <code>Chain</code> consisting of <code>element</code> followed by all elements of this <code>Chain</code>.
*/
final def +:[U >: T](element: U): Chain[U] = new Chain(element +: underlying)
/**
* Adds an element to the beginning of this <code>Chain</code>.
*
* <p>
* Note that :-ending operators are right associative. A mnemonic for <code>+:</code> <em>vs.</em> <code>:+</code> is: the COLon goes on the COLlection side.
* </p>
*
* @param element the element to prepend to this <code>Chain</code>
* @return a <code>Chain</code> that contains <code>element</code> as first element and that continues with this <code>Chain</code>.
*/
final def ::[U >: T](element: U): Chain[U] = new Chain(element +: underlying)
/**
* Returns a new <code>Chain</code> containing the elements of this <code>Chain</code> followed by the elements of the passed <code>Chain</code>.
* The element type of the resulting <code>Chain</code> is the most specific superclass encompassing the element types of this and the passed <code>Chain</code>.
*
* @tparam U the element type of the returned <code>Chain</code>
* @param other the <code>Chain</code> to append
* @return a new <code>Chain</code> that contains all the elements of this <code>Chain</code> followed by all elements of <code>other</code>.
*/
def :::[U >: T](other: Chain[U]): Chain[U] = new Chain(other.toList ::: underlying)
/**
* Returns a new <code>Chain</code> containing the elements of this <code>Chain</code> followed by the elements of the passed <code>Every</code>.
* The element type of the resulting <code>Chain</code> is the most specific superclass encompassing the element types of this and the passed <code>Every</code>.
*
* @tparam U the element type of the returned <code>Chain</code>
* @param other the <code>Every</code> to append
* @return a new <code>Chain</code> that contains all the elements of this <code>Chain</code> followed by all elements of <code>other</code>.
*/
def :::[U >: T](other: Every[U]): Chain[U] = new Chain(other.toList ::: underlying)
/**
* Returns a new <code>Chain</code> containing the elements of this <code>Chain</code> followed by the elements of the passed <code>GenTraversableOnce</code>.
* The element type of the resulting <code>Chain</code> is the most specific superclass encompassing the element types of this <code>Chain</code>
* and the passed <code>GenTraversableOnce</code>.
*
* @tparam U the element type of the returned <code>Chain</code>
* @param other the <code>GenTraversableOnce</code> to append
* @return a new <code>Chain</code> that contains all the elements of this <code>Chain</code> followed by all elements of <code>other</code>.
*/
def :::[U >: T](other: GenTraversableOnce[U]): Chain[U] =
if (other.isEmpty) this else new Chain(other.toList ::: underlying)
/**
* Returns a new <code>Chain</code> with the given element appended.
*
* <p>
* Note a mnemonic for <code>+:</code> <em>vs.</em> <code>:+</code> is: the COLon goes on the COLlection side.
* </p>
*
* @param element the element to append to this <code>Chain</code>
* @return a new <code>Chain</code> consisting of all elements of this <code>Chain</code> followed by <code>element</code>.
*/
def :+[U >: T](element: U): Chain[U] = new Chain(underlying :+ element)
/**
* Appends all elements of this <code>Chain</code> to a string builder. The written text will consist of a concatenation of the result of invoking <code>toString</code>
* on of every element of this <code>Chain</code>, without any separator string.
*
* @param sb the string builder to which elements will be appended
* @return the string builder, <code>sb</code>, to which elements were appended.
*/
final def addString(sb: StringBuilder): StringBuilder = underlying.addString(sb)
/**
* Appends all elements of this <code>Chain</code> to a string builder using a separator string. The written text will consist of a concatenation of the
* result of invoking <code>toString</code>
* on of every element of this <code>Chain</code>, separated by the string <code>sep</code>.
*
* @param sb the string builder to which elements will be appended
* @param sep the separator string
* @return the string builder, <code>sb</code>, to which elements were appended.
*/
final def addString(sb: StringBuilder, sep: String): StringBuilder = underlying.addString(sb, sep)
/**
* Appends all elements of this <code>Chain</code> to a string builder using start, end, and separator strings. The written text will consist of a concatenation of
* the string <code>start</code>; the result of invoking <code>toString</code> on all elements of this <code>Chain</code>,
* separated by the string <code>sep</code>; and the string <code>end</code>
*
* @param sb the string builder to which elements will be appended
* @param start the starting string
* @param sep the separator string
* @param start the ending string
* @return the string builder, <code>sb</code>, to which elements were appended.
*/
final def addString(sb: StringBuilder, start: String, sep: String, end: String): StringBuilder = underlying.addString(sb, start, sep, end)
/**
* Selects an element by its index in the <code>Chain</code>.
*
* @return the element of this <code>Chain</code> at index <code>idx</code>, where 0 indicates the first element.
*/
final def apply(idx: Int): T = underlying(idx)
/**
* Finds the first element of this <code>Chain</code> for which the given partial function is defined, if any, and applies the partial function to it.
*
* @param pf the partial function
* @return an <code>Option</code> containing <code>pf</code> applied to the first element for which it is defined, or <code>None</code> if
* the partial function was not defined for any element.
*/
final def collectFirst[U](pf: PartialFunction[T, U]): Option[U] = underlying.collectFirst(pf)
/**
* Indicates whether this <code>Chain</code> contains a given value as an element.
*
* @param elem the element to look for
* @return true if this <code>Chain</code> has an element that is equal (as determined by <code>==)</code> to <code>elem</code>, false otherwise.
*/
final def contains(elem: Any): Boolean = underlying.contains(elem)
/**
* Indicates whether this <code>Chain</code> contains a given <code>GenSeq</code> as a slice.
*
* @param that the <code>GenSeq</code> slice to look for
* @return true if this <code>Chain</code> contains a slice with the same elements as <code>that</code>, otherwise <code>false</code>.
*/
final def containsSlice[B](that: GenSeq[B]): Boolean = underlying.containsSlice(that)
/**
* Indicates whether this <code>Chain</code> contains a given <code>Every</code> as a slice.
*
* @param that the <code>Every</code> slice to look for
* @return true if this <code>Chain</code> contains a slice with the same elements as <code>that</code>, otherwise <code>false</code>.
*/
final def containsSlice[B](that: Every[B]): Boolean = underlying.containsSlice(that.toVector)
/**
* Indicates whether this <code>Chain</code> contains a given <code>Chain</code> as a slice.
*
* @param that the <code>Chain</code> slice to look for
* @return true if this <code>Chain</code> contains a slice with the same elements as <code>that</code>, otherwise <code>false</code>.
*/
final def containsSlice[B](that: Chain[B]): Boolean = underlying.containsSlice(that.toList)
/**
* Copies values of this <code>Chain</code> to an array. Fills the given array <code>arr</code> with values of this <code>Chain</code>. Copying
* will stop once either the end of the current <code>Chain</code> is reached, or the end of the array is reached.
*
* @param arr the array to fill
*/
final def copyToArray[U >: T](arr: Array[U]): Unit = underlying.copyToArray(arr)
/**
* Copies values of this <code>Chain</code> to an array. Fills the given array <code>arr</code> with values of this <code>Chain</code>, beginning at
* index <code>start</code>. Copying will stop once either the end of the current <code>Chain</code> is reached, or the end of the array is reached.
*
* @param arr the array to fill
* @param start the starting index
*/
final def copyToArray[U >: T](arr: Array[U], start: Int): Unit = underlying.copyToArray(arr, start)
/**
* Copies values of this <code>Chain</code> to an array. Fills the given array <code>arr</code> with at most <code>len</code> elements of this <code>Chain</code>, beginning at
* index <code>start</code>. Copying will stop once either the end of the current <code>Chain</code> is reached, the end of the array is reached, or
* <code>len</code> elements have been copied.
*
* @param arr the array to fill
* @param start the starting index
* @param len the maximum number of elements to copy
*/
final def copyToArray[U >: T](arr: Array[U], start: Int, len: Int): Unit = underlying.copyToArray(arr, start, len)
/**
* Copies all elements of this <code>Chain</code> to a buffer.
*
* @param buf the buffer to which elements are copied
*/
final def copyToBuffer[U >: T](buf: Buffer[U]): Unit = underlying.copyToBuffer(buf)
/**
* Indicates whether every element of this <code>Chain</code> relates to the corresponding element of a given <code>GenSeq</code> by satisfying a given predicate.
*
* @tparam B the type of the elements of <code>that</code>
* @param that the <code>GenSeq</code> to compare for correspondence
* @param p the predicate, which relates elements from this <code>Chain</code> and the passed <code>GenSeq</code>
* @return true if this <code>Chain</code> and the passed <code>GenSeq</code> have the same length and <code>p(x, y)</code> is <code>true</code>
* for all corresponding elements <code>x</code> of this <code>Chain</code> and <code>y</code> of that, otherwise <code>false</code>.
*/
final def corresponds[B](that: GenSeq[B])(p: (T, B) => Boolean): Boolean = underlying.corresponds(that)(p)
/**
* Indicates whether every element of this <code>Chain</code> relates to the corresponding element of a given <code>Every</code> by satisfying a given predicate.
*
* @tparam B the type of the elements of <code>that</code>
* @param that the <code>Every</code> to compare for correspondence
* @param p the predicate, which relates elements from this <code>Chain</code> and the passed <code>Every</code>
* @return true if this <code>Chain</code> and the passed <code>Every</code> have the same length and <code>p(x, y)</code> is <code>true</code>
* for all corresponding elements <code>x</code> of this <code>Chain</code> and <code>y</code> of that, otherwise <code>false</code>.
*/
final def corresponds[B](that: Every[B])(p: (T, B) => Boolean): Boolean = underlying.corresponds(that.toVector)(p)
/**
* Indicates whether every element of this <code>Chain</code> relates to the corresponding element of a given <code>Chain</code> by satisfying a given predicate.
*
* @tparam B the type of the elements of <code>that</code>
* @param that the <code>Chain</code> to compare for correspondence
* @param p the predicate, which relates elements from this and the passed <code>Chain</code>
* @return true if this and the passed <code>Chain</code> have the same length and <code>p(x, y)</code> is <code>true</code>
* for all corresponding elements <code>x</code> of this <code>Chain</code> and <code>y</code> of that, otherwise <code>false</code>.
*/
final def corresponds[B](that: Chain[B])(p: (T, B) => Boolean): Boolean = underlying.corresponds(that.toList)(p)
/**
* Counts the number of elements in this <code>Chain</code> that satisfy a predicate.
*
* @param p the predicate used to test elements.
* @return the number of elements satisfying the predicate <code>p</code>.
*/
final def count(p: T => Boolean): Int = underlying.count(p)
/**
* Builds a new <code>Chain</code> from this <code>Chain</code> without any duplicate elements.
*
* @return A new <code>Chain</code> that contains the first occurrence of every element of this <code>Chain</code>.
*/
final def distinct: Chain[T] = new Chain(underlying.distinct)
/**
* Indicates whether this <code>Chain</code> ends with the given <code>GenSeq</code>.
*
* @param that the sequence to test
* @return <code>true</code> if this <code>Chain</code> has <code>that</code> as a suffix, <code>false</code> otherwise.
*/
final def endsWith[B](that: GenSeq[B]): Boolean = underlying.endsWith(that)
/**
* Indicates whether this <code>Chain</code> ends with the given <code>Every</code>.
*
* @param that the <code>Every</code> to test
* @return <code>true</code> if this <code>Chain</code> has <code>that</code> as a suffix, <code>false</code> otherwise.
*/
final def endsWith[B](that: Every[B]): Boolean = underlying.endsWith(that.toVector)
// TODO: Search for that: Every in here and add a that: Chain in Every.
/**
* Indicates whether this <code>Chain</code> ends with the given <code>Chain</code>.
*
* @param that the <code>Chain</code> to test
* @return <code>true</code> if this <code>Chain</code> has <code>that</code> as a suffix, <code>false</code> otherwise.
*/
final def endsWith[B](that: Chain[B]): Boolean = underlying.endsWith(that.toList)
override def equals(o: Any): Boolean =
o match {
case chain: Chain[_] => underlying == chain.toList
case _ => false
}
/**
* Indicates whether a predicate holds for at least one of the elements of this <code>Chain</code>.
*
* @param the predicate used to test elements.
* @return <code>true</code> if the given predicate <code>p</code> holds for some of the elements of this <code>Chain</code>, otherwise <code>false</code>.
*/
final def exists(p: T => Boolean): Boolean = underlying.exists(p)
/**
* Finds the first element of this <code>Chain</code> that satisfies the given predicate, if any.
*
* @param p the predicate used to test elements
* @return an <code>Some</code> containing the first element in this <code>Chain</code> that satisfies <code>p</code>, or <code>None</code> if none exists.
*/
final def find(p: T => Boolean): Option[T] = underlying.find(p)
/**
* Builds a new <code>Chain</code> by applying a function to all elements of this <code>Chain</code> and using the elements of the resulting <code>Chain</code>s.
*
* @tparam U the element type of the returned <code>Chain</code>
* @param f the function to apply to each element.
* @return a new <code>Chain</code> containing elements obtained by applying the given function <code>f</code> to each element of this <code>Chain</code> and concatenating
* the elements of resulting <code>Chain</code>s.
*/
final def flatMap[U](f: T => Chain[U]): Chain[U] = {
val buf = new ArrayBuffer[U]
for (ele <- underlying)
buf ++= f(ele).toList
new Chain(buf.toList)
}
/**
* Converts this <code>Chain</code> of <code>Chain</code>s into a <code>Chain</code>
* formed by the elements of the nested <code>Chain</code>s.
*
* <p>
* Note: You cannot use this <code>flatten</code> method on a <code>Chain</code> that contains a <code>GenTraversableOnce</code>s, because
* if all the nested <code>GenTraversableOnce</code>s were empty, you'd end up with an empty <code>Chain</code>.
* </p>
*
* @tparm B the type of the elements of each nested <code>Chain</code>
* @return a new <code>Chain</code> resulting from concatenating all nested <code>Chain</code>s.
*/
final def flatten[B](implicit ev: T <:< Chain[B]): Chain[B] = flatMap(ev)
/**
* Folds the elements of this <code>Chain</code> using the specified associative binary operator.
*
* <p>
* The order in which operations are performed on elements is unspecified and may be nondeterministic.
* </p>
*
* @tparam U a type parameter for the binary operator, a supertype of T.
* @param z a neutral element for the fold operation; may be added to the result an arbitrary number of
* times, and must not change the result (<em>e.g.</em>, <code>Nil</code> for list concatenation,
* 0 for addition, or 1 for multiplication.)
* @param op a binary operator that must be associative
* @return the result of applying fold operator <code>op</code> between all the elements and <code>z</code>
*/
final def fold[U >: T](z: U)(op: (U, U) => U): U = underlying.fold(z)(op)
/**
* Applies a binary operator to a start value and all elements of this <code>Chain</code>, going left to right.
*
* @tparam B the result type of the binary operator.
* @param z the start value.
* @param op the binary operator.
* @return the result of inserting <code>op</code> between consecutive elements of this <code>Chain</code>, going left to right, with the start value,
* <code>z</code>, on the left:
*
* <pre>
* op(...op(op(z, x_1), x_2), ..., x_n)
* </pre>
*
* <p>
* where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>Chain</code>.
* </p>
*/
final def foldLeft[B](z: B)(op: (B, T) => B): B = underlying.foldLeft(z)(op)
/**
* Applies a binary operator to all elements of this <code>Chain</code> and a start value, going right to left.
*
* @tparam B the result of the binary operator
* @param z the start value
* @param op the binary operator
* @return the result of inserting <code>op</code> between consecutive elements of this <code>Chain</code>, going right to left, with the start value,
* <code>z</code>, on the right:
*
* <pre>
* op(x_1, op(x_2, ... op(x_n, z)...))
* </pre>
*
* <p>
* where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>Chain</code>.
* </p>
*/
final def foldRight[B](z: B)(op: (T, B) => B): B = underlying.foldRight(z)(op)
/**
* Indicates whether a predicate holds for all elements of this <code>Chain</code>.
*
* @param p the predicate used to test elements.
* @return <code>true</code> if the given predicate <code>p</code> holds for all elements of this <code>Chain</code>, otherwise <code>false</code>.
*/
final def forall(p: T => Boolean): Boolean = underlying.forall(p)
/**
* Applies a function <code>f</code> to all elements of this <code>Chain</code>.
*
* @param f the function that is applied for its side-effect to every element. The result of function <code>f</code> is discarded.
*/
final def foreach(f: T => Unit): Unit = underlying.foreach(f)
/**
* Partitions this <code>Chain</code> into a map of <code>Chain</code>s according to some discriminator function.
*
* @tparam K the type of keys returned by the discriminator function.
* @param f the discriminator function.
* @return A map from keys to <code>Chain</code>s such that the following invariant holds:
*
* <pre>
* (chain.toList partition f)(k) = xs filter (x => f(x) == k)
* </pre>
*
* <p>
* That is, every key <code>k</code> is bound to a <code>Chain</code> of those elements <code>x</code> for which <code>f(x)</code> equals <code>k</code>.
* </p>
*/
final def groupBy[K](f: T => K): Map[K, Chain[T]] = {
val mapKToList = underlying.groupBy(f)
mapKToList.mapValues { list => new Chain(list) }
}
/**
* Partitions elements into fixed size <code>Chain</code>s.
*
* @param size the number of elements per group
* @return An iterator producing <code>Chain</code>s of size <code>size</code>, except the last will be truncated if the elements don't divide evenly.
*/
final def grouped(size: Int): Iterator[Chain[T]] = {
val itOfList = underlying.grouped(size)
itOfList.map { list => new Chain(list) }
}
/**
* Returns <code>true</code> to indicate this <code>Chain</code> has a definite size, since all <code>Chain</code>s are strict collections.
*/
final def hasDefiniteSize: Boolean = true
override def hashCode: Int = underlying.hashCode
/**
* Selects the first element of this <code>Chain</code>.
*
* @return the first element of this <code>Chain</code>.
*/
final def head: T = underlying.head
// Methods like headOption I can't get rid of because of the implicit conversion to GenTraversable.
// Users can call any of the methods I've left out on a Chain, and get whatever List would return
// for that method call. Eventually I'll probably implement them all to save the implicit conversion.
/**
* Selects the first element of this <code>Chain</code> and returns it wrapped in a <code>Some</code>.
*
* @return the first element of this <code>Chain</code>, wrapped in a <code>Some</code>.
*/
final def headOption: Option[T] = underlying.headOption
/**
* Finds index of first occurrence of some value in this <code>Chain</code>.
*
* @param elem the element value to search for.
* @return the index of the first element of this <code>Chain</code> that is equal (as determined by <code>==</code>) to <code>elem</code>,
* or <code>-1</code>, if none exists.
*/
final def indexOf[U >: T](elem: U): Int = underlying.indexOf(elem, 0)
/**
* Finds index of first occurrence of some value in this <code>Chain</code> after or at some start index.
*
* @param elem the element value to search for.
* @param from the start index
* @return the index <code>>=</code> <code>from</code> of the first element of this <code>Chain</code> that is equal (as determined by <code>==</code>) to <code>elem</code>,
* or <code>-1</code>, if none exists.
*/
final def indexOf[U >: T](elem: U, from: Int): Int = underlying.indexOf(elem, from)
/**
* Finds first index where this <code>Chain</code> contains a given <code>GenSeq</code> as a slice.
*
* @param that the <code>GenSeq</code> defining the slice to look for
* @return the first index at which the elements of this <code>Chain</code> starting at that index match the elements of
* <code>GenSeq</code> <code>that</code>, or <code>-1</code> of no such subsequence exists.
*/
final def indexOfSlice[U >: T](that: GenSeq[U]): Int = underlying.indexOfSlice(that)
/**
* Finds first index after or at a start index where this <code>Chain</code> contains a given <code>GenSeq</code> as a slice.
*
* @param that the <code>GenSeq</code> defining the slice to look for
* @param from the start index
* @return the first index <code>>=</code> <code>from</code> at which the elements of this <code>Chain</code> starting at that index match the elements of
* <code>GenSeq</code> <code>that</code>, or <code>-1</code> of no such subsequence exists.
*/
final def indexOfSlice[U >: T](that: GenSeq[U], from: Int): Int = underlying.indexOfSlice(that, from)
/**
* Finds first index where this <code>Chain</code> contains a given <code>Every</code> as a slice.
*
* @param that the <code>Every</code> defining the slice to look for
* @return the first index such that the elements of this <code>Chain</code> starting at this index match the elements of
* <code>Every</code> <code>that</code>, or <code>-1</code> of no such subsequence exists.
*/
final def indexOfSlice[U >: T](that: Every[U]): Int = underlying.indexOfSlice(that.toVector)
/**
* Finds first index where this <code>Chain</code> contains a given <code>Chain</code> as a slice.
*
* @param that the <code>Chain</code> defining the slice to look for
* @return the first index such that the elements of this <code>Chain</code> starting at this index match the elements of
* <code>Chain</code> <code>that</code>, or <code>-1</code> of no such subsequence exists.
*/
final def indexOfSlice[U >: T](that: Chain[U]): Int = underlying.indexOfSlice(that.toList)
/**
* Finds first index after or at a start index where this <code>Chain</code> contains a given <code>Every</code> as a slice.
*
* @param that the <code>Every</code> defining the slice to look for
* @param from the start index
* @return the first index <code>>=</code> <code>from</code> such that the elements of this <code>Chain</code> starting at this index match the elements of
* <code>Every</code> <code>that</code>, or <code>-1</code> of no such subsequence exists.
*/
final def indexOfSlice[U >: T](that: Every[U], from: Int): Int = underlying.indexOfSlice(that.toVector, from)
/**
* Finds first index after or at a start index where this <code>Chain</code> contains a given <code>Chain</code> as a slice.
*
* @param that the <code>Chain</code> defining the slice to look for
* @param from the start index
* @return the first index <code>>=</code> <code>from</code> such that the elements of this <code>Chain</code> starting at this index match the elements of
* <code>Chain</code> <code>that</code>, or <code>-1</code> of no such subsequence exists.
*/
final def indexOfSlice[U >: T](that: Chain[U], from: Int): Int = underlying.indexOfSlice(that.toList, from)
/**
* Finds index of the first element satisfying some predicate.
*
* @param p the predicate used to test elements.
* @return the index of the first element of this <code>Chain</code> that satisfies the predicate <code>p</code>,
* or <code>-1</code>, if none exists.
*/
final def indexWhere(p: T => Boolean): Int = underlying.indexWhere(p)
/**
* Finds index of the first element satisfying some predicate after or at some start index.
*
* @param p the predicate used to test elements.
* @param from the start index
* @return the index <code>>=</code> <code>from</code> of the first element of this <code>Chain</code> that satisfies the predicate <code>p</code>,
* or <code>-1</code>, if none exists.
*/
final def indexWhere(p: T => Boolean, from: Int): Int = underlying.indexWhere(p, from)
/**
* Produces the range of all indices of this <code>Chain</code>.
*
* @return a <code>Range</code> value from <code>0</code> to one less than the length of this <code>Chain</code>.
*/
final def indices: Range = underlying.indices
/**
* Tests whether this <code>Chain</code> contains given index.
*
* @param idx the index to test
* @return true if this <code>Chain</code> contains an element at position <code>idx</code>, <code>false</code> otherwise.
*/
final def isDefinedAt(idx: Int): Boolean = underlying.isDefinedAt(idx)
/**
* Returns <code>false</code> to indicate this <code>Chain</code>, like all <code>Chain<code>s, is non-empty.
*
* @return false
*/
final def isEmpty: Boolean = false
/**
* Returns <code>true</code> to indicate this <code>Chain</code>, like all <code>Chain</code>s, can be traversed repeatedly.
*
* @return true
*/
final def isTraversableAgain: Boolean = true
/**
* Creates and returns a new iterator over all elements contained in this <code>Chain</code>.
*
* @return the new iterator
*/
final def iterator: Iterator[T] = underlying.iterator
/**
* Selects the last element of this <code>Chain</code>.
*
* @return the last element of this <code>Chain</code>.
*/
final def last: T = underlying.last
/**
* Finds the index of the last occurrence of some value in this <code>Chain</code>.
*
* @param elem the element value to search for.
* @return the index of the last element of this <code>Chain</code> that is equal (as determined by <code>==</code>) to <code>elem</code>,
* or <code>-1</code>, if none exists.
*/
final def lastIndexOf[U >: T](elem: U): Int = underlying.lastIndexOf(elem)
/**
* Finds the index of the last occurrence of some value in this <code>Chain</code> before or at a given <code>end</code> index.
*
* @param elem the element value to search for.
* @param end the end index.
* @return the index <code>>=</code> <code>end</code> of the last element of this <code>Chain</code> that is equal (as determined by <code>==</code>)
* to <code>elem</code>, or <code>-1</code>, if none exists.
*/
final def lastIndexOf[U >: T](elem: U, end: Int): Int = underlying.lastIndexOf(elem, end)
/**
* Finds the last index where this <code>Chain</code> contains a given <code>GenSeq</code> as a slice.
*
* @param that the <code>GenSeq</code> defining the slice to look for
* @return the last index at which the elements of this <code>Chain</code> starting at that index match the elements of
* <code>GenSeq</code> <code>that</code>, or <code>-1</code> of no such subsequence exists.
*/
final def lastIndexOfSlice[U >: T](that: GenSeq[U]): Int = underlying.lastIndexOfSlice(that)
/**
* Finds the last index before or at a given end index where this <code>Chain</code> contains a given <code>GenSeq</code> as a slice.
*
* @param that the <code>GenSeq</code> defining the slice to look for
* @param end the end index
* @return the last index <code>>=</code> <code>end</code> at which the elements of this <code>Chain</code> starting at that index match the elements of
* <code>GenSeq</code> <code>that</code>, or <code>-1</code> of no such subsequence exists.
*/
final def lastIndexOfSlice[U >: T](that: GenSeq[U], end: Int): Int = underlying.lastIndexOfSlice(that, end)
/**
* Finds the last index where this <code>Chain</code> contains a given <code>Every</code> as a slice.
*
* @param that the <code>Every</code> defining the slice to look for
* @return the last index at which the elements of this <code>Chain</code> starting at that index match the elements of
* <code>Every</code> <code>that</code>, or <code>-1</code> of no such subsequence exists.
*/
final def lastIndexOfSlice[U >: T](that: Every[U]): Int = underlying.lastIndexOfSlice(that.toVector)
/**
* Finds the last index where this <code>Chain</code> contains a given <code>Chain</code> as a slice.
*
* @param that the <code>Chain</code> defining the slice to look for
* @return the last index at which the elements of this <code>Chain</code> starting at that index match the elements of
* <code>Chain</code> <code>that</code>, or <code>-1</code> of no such subsequence exists.
*/
final def lastIndexOfSlice[U >: T](that: Chain[U]): Int = underlying.lastIndexOfSlice(that.toList)
/**
* Finds the last index before or at a given end index where this <code>Chain</code> contains a given <code>Every</code> as a slice.
*
* @param that the <code>Every</code> defining the slice to look for
* @param end the end index
* @return the last index <code>>=</code> <code>end</code> at which the elements of this <code>Chain</code> starting at that index match the elements of
* <code>Every</code> <code>that</code>, or <code>-1</code> of no such subsequence exists.
*/
final def lastIndexOfSlice[U >: T](that: Every[U], end: Int): Int = underlying.lastIndexOfSlice(that.toVector, end)
/**
* Finds the last index before or at a given end index where this <code>Chain</code> contains a given <code>Chain</code> as a slice.
*
* @param that the <code>Chain</code> defining the slice to look for
* @param end the end index
* @return the last index <code>>=</code> <code>end</code> at which the elements of this <code>Chain</code> starting at that index match the elements of
* <code>Chain</code> <code>that</code>, or <code>-1</code> of no such subsequence exists.
*/
final def lastIndexOfSlice[U >: T](that: Chain[U], end: Int): Int = underlying.lastIndexOfSlice(that.toList, end)
/**
* Finds index of last element satisfying some predicate.
*
* @param p the predicate used to test elements.
* @return the index of the last element of this <code>Chain</code> that satisfies the predicate <code>p</code>, or <code>-1</code>, if none exists.
*/
final def lastIndexWhere(p: T => Boolean): Int = underlying.lastIndexWhere(p)
/**
* Finds index of last element satisfying some predicate before or at given end index.
*
* @param p the predicate used to test elements.
* @param end the end index
* @return the index <code>>=</code> <code>end</code> of the last element of this <code>Chain</code> that satisfies the predicate <code>p</code>,
* or <code>-1</code>, if none exists.
*/
final def lastIndexWhere(p: T => Boolean, end: Int): Int = underlying.lastIndexWhere(p, end)
/**
* Returns the last element of this <code>Chain</code>, wrapped in a <code>Some</code>.
*
* @return the last element, wrapped in a <code>Some</code>.
*/
final def lastOption: Option[T] = underlying.lastOption // Will always return a Some
/**
* The length of this <code>Chain</code>.
*
* <p>
* Note: <code>length</code> and <code>size</code> yield the same result, which will be <code>></code>= 1.
* </p>
*
* @return the number of elements in this <code>Chain</code>.
*/
final def length: Int = underlying.length
/**
* Compares the length of this <code>Chain</code> to a test value.
*
* @param len the test value that gets compared with the length.
* @return a value <code>x</code> where
*
* <pre>
* x < 0 if this.length < len
* x == 0 if this.length == len
* x > 0 if this.length > len
* </pre>
*/
final def lengthCompare(len: Int): Int = underlying.lengthCompare(len)
/**
* Builds a new <code>Chain</code> by applying a function to all elements of this <code>Chain</code>.
*
* @tparam U the element type of the returned <code>Chain</code>.
* @param f the function to apply to each element.
* @return a new <code>Chain</code> resulting from applying the given function <code>f</code> to each element of this <code>Chain</code> and collecting the results.
*/
final def map[U](f: T => U): Chain[U] =
new Chain(underlying.map(f))
/**
* Finds the largest element.
*
* @return the largest element of this <code>Chain</code>.
*/
final def max[U >: T](implicit cmp: Ordering[U]): T = underlying.max(cmp)
/**
* Finds the largest result after applying the given function to every element.
*
* @return the largest result of applying the given function to every element of this <code>Chain</code>.
*/
final def maxBy[U](f: T => U)(implicit cmp: Ordering[U]): T = underlying.maxBy(f)(cmp)
/**
* Finds the smallest element.
*
* @return the smallest element of this <code>Chain</code>.
*/
final def min[U >: T](implicit cmp: Ordering[U]): T = underlying.min(cmp)
/**
* Finds the smallest result after applying the given function to every element.
*
* @return the smallest result of applying the given function to every element of this <code>Chain</code>.
*/
final def minBy[U](f: T => U)(implicit cmp: Ordering[U]): T = underlying.minBy(f)(cmp)
/**
* Displays all elements of this <code>Chain</code> in a string.
*
* @return a string representation of this <code>Chain</code>. In the resulting string, the result of invoking <code>toString</code> on all elements of this
* <code>Chain</code> follow each other without any separator string.
*/
final def mkString: String = underlying.mkString
/**
* Displays all elements of this <code>Chain</code> in a string using a separator string.
*
* @param sep the separator string
* @return a string representation of this <code>Chain</code>. In the resulting string, the result of invoking <code>toString</code> on all elements of this
* <code>Chain</code> are separated by the string <code>sep</code>.
*/
final def mkString(sep: String): String = underlying.mkString(sep)
/**
* Displays all elements of this <code>Chain</code> in a string using start, end, and separator strings.
*
* @param start the starting string.
* @param sep the separator string.
* @param end the ending string.
* @return a string representation of this <code>Chain</code>. The resulting string begins with the string <code>start</code> and ends with the string
* <code>end</code>. Inside, In the resulting string, the result of invoking <code>toString</code> on all elements of this <code>Chain</code> are
* separated by the string <code>sep</code>.
*/
final def mkString(start: String, sep: String, end: String): String = underlying.mkString(start, sep, end)
/**
* Returns <code>true</code> to indicate this <code>Chain</code>, like all <code>Chain</code>s, is non-empty.
*
* @return true
*/
final def nonEmpty: Boolean = true
/**
* A copy of this <code>Chain</code> with an element value appended until a given target length is reached.
*
* @param len the target length
* @param elem he padding value
* @return a new <code>Chain</code> consisting of all elements of this <code>Chain</code> followed by the minimal number of occurrences
* of <code>elem</code> so that the resulting <code>Chain</code> has a length of at least <code>len</code>.
*/
final def padTo[U >: T](len: Int, elem: U): Chain[U] =
new Chain(underlying.padTo(len, elem))
/**
* Produces a new <code>Chain</code> where a slice of elements in this <code>Chain</code> is replaced by another <code>Chain</code>
*
* @param from the index of the first replaced element
* @param that the <code>Chain</code> whose elements should replace a slice in this <code>Chain</code>
* @param replaced the number of elements to drop in the original <code>Chain</code>
*/
final def patch[U >: T](from: Int, that: Chain[U], replaced: Int): Chain[U] =
new Chain(underlying.patch(from, that.toVector, replaced))
/**
* Iterates over distinct permutations.
*
* <p>
* Here's an example:
* </p>
*
* <pre class="stHighlight">
* Chain('a', 'b', 'b').permutations.toList = List(Chain(a, b, b), Chain(b, a, b), Chain(b, b, a))
* </pre>
*
* @return an iterator that traverses the distinct permutations of this <code>Chain</code>.
*/
final def permutations: Iterator[Chain[T]] = {
val it = underlying.permutations
it map { list => new Chain(list) }
}
/**
* Returns the length of the longest prefix whose elements all satisfy some predicate.
*
* @param p the predicate used to test elements.
* @return the length of the longest prefix of this <code>Chain</code> such that every element
* of the segment satisfies the predicate <code>p</code>.
*/
final def prefixLength(p: T => Boolean): Int = underlying.prefixLength(p)
/**
* The result of multiplying all the elements of this <code>Chain</code>.
*
* <p>
* This method can be invoked for any <code>Chain[T]</code> for which an implicit <code>Numeric[T]</code> exists.
* </p>
*
* @return the product of all elements
*/
final def product[U >: T](implicit num: Numeric[U]): U = underlying.product(num)
/**
* Reduces the elements of this <code>Chain</code> using the specified associative binary operator.
*
* <p>
* The order in which operations are performed on elements is unspecified and may be nondeterministic.
* </p>
*
* @tparam U a type parameter for the binary operator, a supertype of T.
* @param op a binary operator that must be associative.
* @return the result of applying reduce operator <code>op</code> between all the elements of this <code>Chain</code>.
*/
final def reduce[U >: T](op: (U, U) => U): U = underlying.reduce(op)
/**
* Applies a binary operator to all elements of this <code>Chain</code>, going left to right.
*
* @tparam U the result type of the binary operator.
* @param op the binary operator.
* @return the result of inserting <code>op</code> between consecutive elements of this <code>Chain</code>, going left to right:
*
* <pre>
* op(...op(op(x_1, x_2), x_3), ..., x_n)
* </pre>
*
* <p>
* where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>Chain</code>.
* </p>
*/
final def reduceLeft[U >: T](op: (U, T) => U): U = underlying.reduceLeft(op)
/**
* Applies a binary operator to all elements of this <code>Chain</code>, going left to right, returning the result in a <code>Some</code>.
*
* @tparam U the result type of the binary operator.
* @param op the binary operator.
* @return a <code>Some</code> containing the result of <code>reduceLeft(op)</code>
* </p>
*/
final def reduceLeftOption[U >: T](op: (U, T) => U): Option[U] = underlying.reduceLeftOption(op)
final def reduceOption[U >: T](op: (U, U) => U): Option[U] = underlying.reduceOption(op)
/**
* Applies a binary operator to all elements of this <code>Chain</code>, going right to left.
*
* @tparam U the result of the binary operator
* @param op the binary operator
* @return the result of inserting <code>op</code> between consecutive elements of this <code>Chain</code>, going right to left:
*
* <pre>
* op(x_1, op(x_2, ... op(x_{n-1}, x_n)...))
* </pre>
*
* <p>
* where x<sub>1</sub>, ..., x<sub>n</sub> are the elements of this <code>Chain</code>.
* </p>
*/
final def reduceRight[U >: T](op: (T, U) => U): U = underlying.reduceRight(op)
/**
* Applies a binary operator to all elements of this <code>Chain</code>, going right to left, returning the result in a <code>Some</code>.
*
* @tparam U the result of the binary operator
* @param op the binary operator
* @return a <code>Some</code> containing the result of <code>reduceRight(op)</code>
*/
final def reduceRightOption[U >: T](op: (T, U) => U): Option[U] = underlying.reduceRightOption(op)
/**
* Returns new <code>Chain</code> with elements in reverse order.
*
* @return a new <code>Chain</code> with all elements of this <code>Chain</code> in reversed order.
*/
final def reverse: Chain[T] =
new Chain(underlying.reverse)
/**
* An iterator yielding elements in reverse order.
*
* <p>
* Note: <code>chain.reverseIterator</code> is the same as <code>chain.reverse.iterator</code>, but might be more efficient.
* </p>
*
* @return an iterator yielding the elements of this <code>Chain</code> in reversed order
*/
final def reverseIterator: Iterator[T] = underlying.reverseIterator
/**
* Builds a new <code>Chain</code> by applying a function to all elements of this <code>Chain</code> and collecting the results in reverse order.
*
* <p>
* Note: <code>chain.reverseMap(f)</code> is the same as <code>chain.reverse.map(f)</code>, but might be more efficient.
* </p>
*
* @tparam U the element type of the returned <code>Chain</code>.
* @param f the function to apply to each element.
* @return a new <code>Chain</code> resulting from applying the given function <code>f</code> to each element of this <code>Chain</code>
* and collecting the results in reverse order.
*/
final def reverseMap[U](f: T => U): Chain[U] =
new Chain(underlying.reverseMap(f))
/**
* Checks if the given <code>GenIterable</code> contains the same elements in the same order as this <code>Chain</code>.
*
* @param that the <code>GenIterable</code> with which to compare
* @return <code>true</code>, if both this <code>Chain</code> and the given <code>GenIterable</code> contain the same elements
* in the same order, <code>false</code> otherwise.
*/
final def sameElements[U >: T](that: GenIterable[U]): Boolean = underlying.sameElements(that)
/**
* Checks if the given <code>Every</code> contains the same elements in the same order as this <code>Chain</code>.
*
* @param that the <code>Every</code> with which to compare
* @return <code>true</code>, if both this and the given <code>Every</code> contain the same elements
* in the same order, <code>false</code> otherwise.
*/
final def sameElements[U >: T](that: Every[U]): Boolean = underlying.sameElements(that.toVector)
/**
* Checks if the given <code>Chain</code> contains the same elements in the same order as this <code>Chain</code>.
*
* @param that the <code>Chain</code> with which to compare
* @return <code>true</code>, if both this and the given <code>Chain</code> contain the same elements
* in the same order, <code>false</code> otherwise.
*/
final def sameElements[U >: T](that: Chain[U]): Boolean = underlying.sameElements(that.toList)
/**
* Computes a prefix scan of the elements of this <code>Chain</code>.
*
* <p>
* Note: The neutral element z may be applied more than once.
* </p>
*
* <p>
* Here are some examples:
* </p>
*
* <pre class="stHighlight">
* Chain(1, 2, 3).scan(0)(_ + _) == Chain(0, 1, 3, 6)
* Chain(1, 2, 3).scan("z")(_ + _.toString) == Chain("z", "z1", "z12", "z123")
* </pre>
*
* @tparam U a type parameter for the binary operator, a supertype of T, and the type of the resulting <code>Chain</code>.
* @param z a neutral element for the scan operation; may be added to the result an arbitrary number of
* times, and must not change the result (<em>e.g.</em>, <code>Nil</code> for list concatenation,
* 0 for addition, or 1 for multiplication.)
* @param op a binary operator that must be associative
* @return a new <code>Chain</code> containing the prefix scan of the elements in this <code>Chain</code>
*/
final def scan[U >: T](z: U)(op: (U, U) => U): Chain[U] = new Chain(underlying.scan(z)(op))
/**
* Produces a <code>Chain</code> containing cumulative results of applying the operator going left to right.
*
* <p>
* Here are some examples:
* </p>
*
* <pre class="stHighlight">
* Chain(1, 2, 3).scanLeft(0)(_ + _) == Chain(0, 1, 3, 6)
* Chain(1, 2, 3).scanLeft("z")(_ + _) == Chain("z", "z1", "z12", "z123")
* </pre>
*
* @tparam B the result type of the binary operator and type of the resulting <code>Chain</code>
* @param z the start value.
* @param op the binary operator.
* @return a new <code>Chain</code> containing the intermediate results of inserting <code>op</code> between consecutive elements of this <code>Chain</code>,
* going left to right, with the start value, <code>z</code>, on the left.
*/
final def scanLeft[B](z: B)(op: (B, T) => B): Chain[B] = new Chain(underlying.scanLeft(z)(op))
/**
* Produces a <code>Chain</code> containing cumulative results of applying the operator going right to left.
*
* <p>
* Here are some examples:
* </p>
*
* <pre class="stHighlight">
* Chain(1, 2, 3).scanRight(0)(_ + _) == Chain(6, 5, 3, 0)
* Chain(1, 2, 3).scanRight("z")(_ + _) == Chain("123z", "23z", "3z", "z")
* </pre>
*
* @tparam B the result of the binary operator and type of the resulting <code>Chain</code>
* @param z the start value
* @param op the binary operator
* @return a new <code>Chain</code> containing the intermediate results of inserting <code>op</code> between consecutive elements of this <code>Chain</code>,
* going right to left, with the start value, <code>z</code>, on the right.
*/
final def scanRight[B](z: B)(op: (T, B) => B): Chain[B] = new Chain(underlying.scanRight(z)(op))
/**
* Computes length of longest segment whose elements all satisfy some predicate.
*
* @param p the predicate used to test elements.
* @param from the index where the search starts.
* @param the length of the longest segment of this <code>Chain</code> starting from index <code>from</code> such that every element of the
* segment satisfies the predicate <code>p</code>.
*/
final def segmentLength(p: T => Boolean, from: Int): Int = underlying.segmentLength(p, from)
/**
* Groups elements in fixed size blocks by passing a “sliding window” over them (as opposed to partitioning them, as is done in grouped.)
*
* @param size the number of elements per group
* @return an iterator producing <code>Chain</code>s of size <code>size</code>, except the last and the only element will be truncated
* if there are fewer elements than <code>size</code>.
*/
final def sliding(size: Int): Iterator[Chain[T]] = underlying.sliding(size).map(new Chain(_))
/**
* Groups elements in fixed size blocks by passing a “sliding window” over them (as opposed to partitioning them, as is done in grouped.),
* moving the sliding window by a given <code>step</code> each time.
*
* @param size the number of elements per group
* @param step the distance between the first elements of successive groups
* @return an iterator producing <code>Chain</code>s of size <code>size</code>, except the last and the only element will be truncated
* if there are fewer elements than <code>size</code>.
*/
final def sliding(size: Int, step: Int): Iterator[Chain[T]] = underlying.sliding(size, step).map(new Chain(_))
/**
* The size of this <code>Chain</code>.
*
* <p>
* Note: <code>length</code> and <code>size</code> yield the same result, which will be <code>></code>= 1.
* </p>
*
* @return the number of elements in this <code>Chain</code>.
*/
final def size: Int = underlying.size
/**
* Sorts this <code>Chain</code> according to the <code>Ordering</code> of the result of applying the given function to every element.
*
* @tparam U the target type of the transformation <code>f</code>, and the type where the <code>Ordering</code> <code>ord</code> is defined.
* @param f the transformation function mapping elements to some other domain <code>U</code>.
* @param ord the ordering assumed on domain <code>U</code>.
* @return a <code>Chain</code> consisting of the elements of this <code>Chain</code> sorted according to the <code>Ordering</code> where
* <code>x < y if ord.lt(f(x), f(y))</code>.
*/
final def sortBy[U](f: T => U)(implicit ord: Ordering[U]): Chain[T] = new Chain(underlying.sortBy(f))
/**
* Sorts this <code>Chain</code> according to a comparison function.
*
* <p>
* The sort is stable. That is, elements that are equal (as determined by <code>lt</code>) appear in the same order in the
* sorted <code>Chain</code> as in the original.
* </p>
*
* @param the comparison function that tests whether its first argument precedes its second argument in the desired ordering.
* @return a <code>Chain</code> consisting of the elements of this <code>Chain</code> sorted according to the comparison function <code>lt</code>.
*/
final def sortWith(lt: (T, T) => Boolean): Chain[T] = new Chain(underlying.sortWith(lt))
/**
* Sorts this <code>Chain</code> according to an <code>Ordering</code>.
*
* <p>
* The sort is stable. That is, elements that are equal (as determined by <code>lt</code>) appear in the same order in the
* sorted <code>Chain</code> as in the original.
* </p>
*
* @param ord the <code>Ordering</code> to be used to compare elements.
* @param the comparison function that tests whether its first argument precedes its second argument in the desired ordering.
* @return a <code>Chain</code> consisting of the elements of this <code>Chain</code> sorted according to the comparison function <code>lt</code>.
*/
final def sorted[U >: T](implicit ord: Ordering[U]): Chain[U] = new Chain(underlying.sorted(ord))
/**
* Indicates whether this <code>Chain</code> starts with the given <code>GenSeq</code>.
*
* @param that the <code>GenSeq</code> slice to look for in this <code>Chain</code>
* @return <code>true</code> if this <code>Chain</code> has <code>that</code> as a prefix, <code>false</code> otherwise.
*/
final def startsWith[B](that: GenSeq[B]): Boolean = underlying.startsWith(that)
/**
* Indicates whether this <code>Chain</code> starts with the given <code>GenSeq</code> at the given index.
*
* @param that the <code>GenSeq</code> slice to look for in this <code>Chain</code>
* @param offset the index at which this <code>Chain</code> is searched.
* @return <code>true</code> if this <code>Chain</code> has <code>that</code> as a slice at the index <code>offset</code>, <code>false</code> otherwise.
*/
final def startsWith[B](that: GenSeq[B], offset: Int): Boolean = underlying.startsWith(that, offset)
/**
* Indicates whether this <code>Chain</code> starts with the given <code>Every</code>.
*
* @param that the <code>Every</code> to test
* @return <code>true</code> if this collection has <code>that</code> as a prefix, <code>false</code> otherwise.
*/
final def startsWith[B](that: Every[B]): Boolean = underlying.startsWith(that.toVector)
/**
* Indicates whether this <code>Chain</code> starts with the given <code>Chain</code>.
*
* @param that the <code>Chain</code> to test
* @return <code>true</code> if this collection has <code>that</code> as a prefix, <code>false</code> otherwise.
*/
final def startsWith[B](that: Chain[B]): Boolean = underlying.startsWith(that.toList)
/**
* Indicates whether this <code>Chain</code> starts with the given <code>Every</code> at the given index.
*
* @param that the <code>Every</code> slice to look for in this <code>Chain</code>
* @param offset the index at which this <code>Chain</code> is searched.
* @return <code>true</code> if this <code>Chain</code> has <code>that</code> as a slice at the index <code>offset</code>, <code>false</code> otherwise.
*/
final def startsWith[B](that: Every[B], offset: Int): Boolean = underlying.startsWith(that.toVector, offset)
/**
* Indicates whether this <code>Chain</code> starts with the given <code>Chain</code> at the given index.
*
* @param that the <code>Chain</code> slice to look for in this <code>Chain</code>
* @param offset the index at which this <code>Chain</code> is searched.
* @return <code>true</code> if this <code>Chain</code> has <code>that</code> as a slice at the index <code>offset</code>, <code>false</code> otherwise.
*/
final def startsWith[B](that: Chain[B], offset: Int): Boolean = underlying.startsWith(that.toList, offset)
/**
* Returns <code>"Chain"</code>, the prefix of this object's <code>toString</code> representation.
*
* @return the string <code>"Chain"</code>
*/
def stringPrefix: String = "Chain"
/**
* The result of summing all the elements of this <code>Chain</code>.
*
* <p>
* This method can be invoked for any <code>Chain[T]</code> for which an implicit <code>Numeric[T]</code> exists.
* </p>
*
* @return the sum of all elements
*/
final def sum[U >: T](implicit num: Numeric[U]): U = underlying.sum(num)
import scala.language.higherKinds
/**
* Converts this <code>Chain</code> into a collection of type <code>Col</code> by copying all elements.
*
* @tparam Col the collection type to build.
* @return a new collection containing all elements of this <code>Chain</code>.
*/
final def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, T, Col[T @uV]]): Col[T @uV] = underlying.to[Col](cbf)
/**
* Converts this <code>Chain</code> to an array.
*
* @return an array containing all elements of this <code>Chain</code>. A <code>ClassTag</code> must be available for the element type of this <code>Chain</code>.
*/
final def toArray[U >: T](implicit classTag: ClassTag[U]): Array[U] = underlying.toArray
/**
* Converts this <code>Chain</code> to a <code>Vector</code>.
*
* @return a <code>Vector</code> containing all elements of this <code>Chain</code>.
*/
final def toVector: Vector[T] = underlying.toVector
/**
* Converts this <code>Chain</code> to a mutable buffer.
*
* @return a buffer containing all elements of this <code>Chain</code>.
*/
final def toBuffer[U >: T]: Buffer[U] = underlying.toBuffer
/**
* Converts this <code>Chain</code> to an immutable <code>IndexedSeq</code>.
*
* @return an immutable <code>IndexedSeq</code> containing all elements of this <code>Chain</code>.
*/
final def toIndexedSeq: collection.immutable.IndexedSeq[T] = underlying.toVector
/**
* Converts this <code>Chain</code> to an iterable collection.
*
* @return an <code>Iterable</code> containing all elements of this <code>Chain</code>.
*/
final def toIterable: Iterable[T] = underlying.toIterable
/**
* Returns an <code>Iterator</code> over the elements in this <code>Chain</code>.
*
* @return an <code>Iterator</code> containing all elements of this <code>Chain</code>.
*/
final def toIterator: Iterator[T] = underlying.toIterator
/**
* Converts this <code>Chain</code> to a list.
*
* @return a list containing all elements of this <code>Chain</code>.
*/
final def toList: List[T] = underlying
/**
* Converts this <code>Chain</code> to a map.
*
* <p>
* This method is unavailable unless the elements are members of <code>Tuple2</code>, each <code>((K, V))</code> becoming a key-value pair
* in the map. Duplicate keys will be overwritten by later keys.
* </p>
*
* @return a map of type <code>immutable.Map[K, V]</code> containing all key/value pairs of type <code>(K, V)</code> of this <code>Chain</code>.
*/
final def toMap[K, V](implicit ev: T <:< (K, V)): Map[K, V] = underlying.toMap
/**
* Converts this <code>Chain</code> to an immutable <code>IndexedSeq</code>.
*
* @return an immutable <code>IndexedSeq</code> containing all elements of this <code>Chain</code>.
*/
final def toSeq: collection.immutable.Seq[T] = underlying
/**
* Converts this <code>Chain</code> to a set.
*
* @return a set containing all elements of this <code>Chain</code>.
*/
final def toSet[U >: T]: Set[U] = underlying.toSet
/**
* Converts this <code>Chain</code> to a stream.
*
* @return a stream containing all elements of this <code>Chain</code>.
*/
final def toStream: Stream[T] = underlying.toStream
/**
* Returns a string representation of this <code>Chain</code>.
*
* @return the string <code>"Chain"</code> followed by the result of invoking <code>toString</code> on
* this <code>Chain</code>'s elements, surrounded by parentheses.
*/
override def toString: String = "Chain(" + toList.mkString(", ") + ")"
/**
* Converts this <code>Chain</code> to an unspecified Traversable.
*
* @return a <code>Traversable</code> containing all elements of this <code>Chain</code>.
*/
final def toTraversable: Traversable[T] = underlying.toTraversable
final def transpose[U](implicit ev: T <:< Chain[U]): Chain[Chain[U]] = {
val asLists = underlying.map(ev)
val list = asLists.transpose
new Chain(list.map(new Chain(_)))
}
/**
* Produces a new <code>Chain</code> that contains all elements of this <code>Chain</code> and also all elements of a given <code>Every</code>.
*
* <p>
* <code>chainX</code> <code>union</code> <code>everyY</code> is equivalent to <code>chainX</code> <code>++</code> <code>everyY</code>.
* </p>
*
* <p>
* Another way to express this is that <code>chainX</code> <code>union</code> <code>everyY</code> computes the order-presevring multi-set union
* of <code>chainX</code> and <code>everyY</code>. This <code>union</code> method is hence a counter-part of <code>diff</code> and <code>intersect</code> that
* also work on multi-sets.
* </p>
*
* @param that the <code>Every</code> to add.
* @return a new <code>Chain</code> that contains all elements of this <code>Chain</code> followed by all elements of <code>that</code> <code>Every</code>.
*/
final def union[U >: T](that: Every[U]): Chain[U] = new Chain(underlying union that.toVector)
/**
* Produces a new <code>Chain</code> that contains all elements of this <code>Chain</code> and also all elements of a given <code>Chain</code>.
*
* <p>
* <code>chainX</code> <code>union</code> <code>chainY</code> is equivalent to <code>chainX</code> <code>++</code> <code>chainY</code>.
* </p>
*
* <p>
* Another way to express this is that <code>chainX</code> <code>union</code> <code>chainY</code> computes the order-presevring multi-set union
* of <code>chainX</code> and <code>chainY</code>. This <code>union</code> method is hence a counter-part of <code>diff</code> and <code>intersect</code> that
* also work on multi-sets.
* </p>
*
* @param that the <code>Chain</code> to add.
* @return a new <code>Chain</code> that contains all elements of this <code>Chain</code> followed by all elements of <code>that</code>.
*/
final def union[U >: T](that: Chain[U]): Chain[U] = new Chain(underlying union that.toList)
/**
* Produces a new <code>Chain</code> that contains all elements of this <code>Chain</code> and also all elements of a given <code>GenSeq</code>.
*
* <p>
* <code>chainX</code> <code>union</code> <code>ys</code> is equivalent to <code>chainX</code> <code>++</code> <code>ys</code>.
* </p>
*
* <p>
* Another way to express this is that <code>chainX</code> <code>union</code> <code>ys</code> computes the order-presevring multi-set union
* of <code>chainX</code> and <code>ys</code>. This <code>union</code> method is hence a counter-part of <code>diff</code> and <code>intersect</code> that
* also work on multi-sets.
* </p>
*
* @param that the <code>GenSeq</code> to add.
* @return a new <code>Chain</code> that contains all elements of this <code>Chain</code> followed by all elements of <code>that</code> <code>GenSeq</code>.
*/
final def union[U >: T](that: GenSeq[U])(implicit cbf: CanBuildFrom[List[T], U, List[U]]): Chain[U] = new Chain(underlying.union(that)(cbf))
/**
* Converts this <code>Chain</code> of pairs into two <code>Chain</code>s of the first and second half of each pair.
*
* @tparam L the type of the first half of the element pairs
* @tparam R the type of the second half of the element pairs
* @param asPair an implicit conversion that asserts that the element type of this <code>Chain</code> is a pair.
* @return a pair of <code>Chain</code>s, containing the first and second half, respectively, of each element pair of this <code>Chain</code>.
*/
final def unzip[L, R](implicit asPair: T => (L, R)): (Chain[L], Chain[R]) = {
val unzipped = underlying.unzip
(new Chain(unzipped._1), new Chain(unzipped._2))
}
/**
* Converts this <code>Chain</code> of triples into three <code>Chain</code>s of the first, second, and and third element of each triple.
*
* @tparam L the type of the first member of the element triples
* @tparam R the type of the second member of the element triples
* @tparam R the type of the third member of the element triples
* @param asTriple an implicit conversion that asserts that the element type of this <code>Chain</code> is a triple.
* @return a triple of <code>Chain</code>s, containing the first, second, and third member, respectively, of each element triple of this <code>Chain</code>.
*/
final def unzip3[L, M, R](implicit asTriple: T => (L, M, R)): (Chain[L], Chain[M], Chain[R]) = {
val unzipped = underlying.unzip3
(new Chain(unzipped._1), new Chain(unzipped._2), new Chain(unzipped._3))
}
/**
* A copy of this <code>Chain</code> with one single replaced element.
*
* @param idx the position of the replacement
* @param elem the replacing element
* @throws IndexOutOfBoundsException if the passed index is greater than or equal to the length of this <code>Chain<code>
* @return a copy of this <code>Chain</code> with the element at position <code>idx</code> replaced by <code>elem</code>.
*/
final def updated[U >: T](idx: Int, elem: U): Chain[U] =
try new Chain(underlying.updated(idx, elem))
catch { case _: UnsupportedOperationException => throw new IndexOutOfBoundsException(idx.toString) } // This is needed for 2.10 support. Can drop after.
// Because 2.11 throws IndexOutOfBoundsException.
/**
* Returns a <code>Chain</code> formed from this <code>Chain</code> and an iterable collection by combining corresponding
* elements in pairs. If one of the two collections is shorter than the other, placeholder elements will be used to extend the
* shorter collection to the length of the longer.
*
* @tparm O the type of the second half of the returned pairs
* @tparm U the type of the first half of the returned pairs
* @param other the <code>Iterable</code> providing the second half of each result pair
* @param thisElem the element to be used to fill up the result if this <code>Chain</code> is shorter than <code>that</code> <code>Iterable</code>.
* @param thatElem the element to be used to fill up the result if <code>that</code> <code>Iterable</code> is shorter than this <code>Chain</code>.
* @return a new <code>Chain</code> containing pairs consisting of corresponding elements of this <code>Chain</code> and <code>that</code>. The
* length of the returned collection is the maximum of the lengths of this <code>Chain</code> and <code>that</code>. If this <code>Chain</code>
* is shorter than <code>that</code>, <code>thisElem</code> values are used to pad the result. If <code>that</code> is shorter than this
* <code>Chain</code>, <code>thatElem</code> values are used to pad the result.
*/
final def zipAll[O, U >: T](other: collection.Iterable[O], thisElem: U, otherElem: O): Chain[(U, O)] =
new Chain(underlying.zipAll(other, thisElem, otherElem))
/**
* Zips this <code>Chain</code> with its indices.
*
* @return A new <code>Chain</code> containing pairs consisting of all elements of this <code>Chain</code> paired with their index. Indices start at 0.
*/
final def zipWithIndex: Chain[(T, Int)] = new Chain(underlying.zipWithIndex)
}
/**
* Companion object for class <code>Chain</code>.
*/
object Chain {
/**
* Constructs a new <code>Chain</code> given at least one element.
*
* @tparam T the type of the element contained in the new <code>Chain</code>
* @param firstElement the first element (with index 0) contained in this <code>Chain</code>
* @param otherElements a varargs of zero or more other elements (with index 1, 2, 3, ...) contained in this <code>Chain</code>
*/
def apply[T](firstElement: T, otherElements: T*): Chain[T] = new Chain(firstElement :: otherElements.toList)
/**
* Variable argument extractor for <code>Chain</code>s.
*
* @param chain: the <code>Chain</code> containing the elements to extract
* @return an <code>Seq</code> containing this <code>Chain</code>s elements, wrapped in a <code>Some</code>
*/
def unapplySeq[T](chain: Chain[T]): Option[Seq[T]] = Some(chain.toList)
/*
// TODO: Figure out how to get case Chain() to not compile
def unapplySeq[T](chain: Chain[T]): Option[(T, Seq[T])] = Some(chain.head, chain.tail)
*/
/**
* Optionally construct a <code>Chain</code> containing the elements, if any, of a given <code>GenSeq</code>.
*
* @param seq the <code>GenSeq</code> with which to construct a <code>Chain</code>
* @return a <code>Chain</code> containing the elements of the given <code>GenSeq</code>, if non-empty, wrapped in
* a <code>Some</code>; else <code>None</code> if the <code>GenSeq</code> is empty
*/
def from[T](seq: GenSeq[T]): Option[Chain[T]] =
seq.headOption match {
case None => None
case Some(first) => Some(new Chain(first :: seq.tail.toList))
}
import scala.language.implicitConversions
/**
* Implicit conversion from <code>Chain</code> to <code>List</code>.
*
* <p>
* One use case for this implicit conversion is to enable <code>GenSeq[Chain]</code>s to be flattened.
* Here's an example:
* </p>
*
* <pre class="stREPL">
* scala> Vector(Chain(1, 2, 3), Chain(3, 4), Chain(5, 6, 7, 8)).flatten
* res0: scala.collection.immutable.Vector[Int] = Vector(1, 2, 3, 3, 4, 5, 6, 7, 8)
* </pre>
*
* @param chain the <code>Chain</code> to convert to a <code>List</code>
* @return a <code>List</code> containing the elements, in order, of this <code>Chain</code>
*/
implicit def chainToList[E](chain: Chain[E]): scala.collection.immutable.List[E] = chain.toList
}
/**
* Object that can be used as an endpoint for <code>Chain</code> construction expressions
* that use the cons (<code>::</code>) operator.
*
* <p>
* Here's an example:
* </p>
*
* <pre class="REPL">
* scala> 1 :: 2 :: 3 :: End
* res0: org.scalactic.Chain[Int] = Chain(1, 2, 3)
* </pre>
*
* <p>
* Note that unlike <code>Nil</code>, which is an instance of <code>List[Nothing]</code>,
* <code>End</code> is not an instance of <code>Chain[Nothing]</code>, because there is
* no empty <code>Chain</code>:
* </p>
*
* <pre class="REPL">
* scala> Nil.isInstanceOf[List[_]]
* res0: Boolean = true
*
* scala> End.isInstanceOf[Chain[_]]
* res1: Boolean = false
* </pre>
*/
object End {
/**
* A <code>::</code> operator that serves to start a <code>Chain</code> construction
* expression.
*
* <p>
* The result of calling this method will always be a <code>Chain</code> of length 1.
* Here's an example:
* </p>
*
* <pre class="REPL">
* scala> 1 :: End
* res0: org.scalactic.Chain[Int] = Chain(1)
* </pre>
*/
def ::[T](element: T): Chain[T] = Chain(element)
/**
* Returns <code>"End"</code>.
*/
override def toString: String = "End"
}
| {
"content_hash": "f4c842a82826c6d68b047e8919f20075",
"timestamp": "",
"source": "github",
"line_count": 1739,
"max_line_length": 182,
"avg_line_length": 45.96147211040828,
"alnum_prop": 0.6607154028050596,
"repo_name": "janekdb/scalatest",
"id": "78a1992f16d5c45066ad034bf4c73ee12d2046e6",
"size": "80527",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "scalactic/src/main/scala/org/scalactic/Chain.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "14110"
},
{
"name": "HTML",
"bytes": "11321"
},
{
"name": "Java",
"bytes": "47034"
},
{
"name": "JavaScript",
"bytes": "19211"
},
{
"name": "Scala",
"bytes": "24292933"
},
{
"name": "Shell",
"bytes": "14579"
}
],
"symlink_target": ""
} |
"use strict";
define(['ng-currency-mask',
'angular-ngMask',
'angular-bootstrap',
'angular-file-upload',
'app-common-components',
'angular-toastr'], function () {
angular.module("app.external.components", [ 'ngCurrencyMask',
'ngMask',
'ui.bootstrap',
'angularFileUpload',
'toastr' ]);
angular.module("app.common", ['app.external.components', 'app.common.components']);
}); | {
"content_hash": "019a7428afbcf624b9acdd7f2d109067",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 87,
"avg_line_length": 34.166666666666664,
"alnum_prop": 0.43089430894308944,
"repo_name": "karluqs/papai-noel-velho-batuta",
"id": "6dc823fbf67fe705924ec1f938321453d01c70b2",
"size": "615",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/common/common-app.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2527"
},
{
"name": "HTML",
"bytes": "11646"
},
{
"name": "JavaScript",
"bytes": "31840"
}
],
"symlink_target": ""
} |
<?php
namespace cd;
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__).'/../core/');
require_once('FtpClient.php');
$x = new FtpClient();
$x->setAddress('sftp://username:[email protected]:12346/path/to/file');
if ($x->getUrl() != 'sftp://username:[email protected]:12346/path/to/file') echo "FAIL 1\n";
?>
| {
"content_hash": "4045cf9f40cbb79526f100a1ba4174a1",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 94,
"avg_line_length": 24.142857142857142,
"alnum_prop": 0.6627218934911243,
"repo_name": "martinlindhe/core_dev",
"id": "6f724fcc5d2b5071302b7fb5de7a011d8c948684",
"size": "338",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/test.FtpClient.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "16271"
},
{
"name": "CSS",
"bytes": "286295"
},
{
"name": "JavaScript",
"bytes": "8868727"
},
{
"name": "Makefile",
"bytes": "291"
},
{
"name": "PHP",
"bytes": "1410870"
}
],
"symlink_target": ""
} |
package com.google.cloud.dataproc.v1.samples;
// [START dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_async]
import com.google.api.core.ApiFuture;
import com.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest;
import com.google.cloud.dataproc.v1.RegionName;
import com.google.cloud.dataproc.v1.WorkflowTemplate;
import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient;
public class AsyncListWorkflowTemplates {
public static void main(String[] args) throws Exception {
asyncListWorkflowTemplates();
}
public static void asyncListWorkflowTemplates() throws Exception {
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
WorkflowTemplateServiceClient.create()) {
ListWorkflowTemplatesRequest request =
ListWorkflowTemplatesRequest.newBuilder()
.setParent(RegionName.of("[PROJECT]", "[REGION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<WorkflowTemplate> future =
workflowTemplateServiceClient.listWorkflowTemplatesPagedCallable().futureCall(request);
// Do something.
for (WorkflowTemplate element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
}
}
// [END dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_async]
| {
"content_hash": "f7bef813a24a52ce8b369f69858e1363",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 100,
"avg_line_length": 44.048780487804876,
"alnum_prop": 0.7441860465116279,
"repo_name": "googleapis/google-cloud-java",
"id": "de9f5ea0554bb9d7c29b3cf7ebb6f5dc6470a655",
"size": "2401",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateservice/listworkflowtemplates/AsyncListWorkflowTemplates.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "2614"
},
{
"name": "HCL",
"bytes": "28592"
},
{
"name": "Java",
"bytes": "826434232"
},
{
"name": "Jinja",
"bytes": "2292"
},
{
"name": "Python",
"bytes": "200408"
},
{
"name": "Shell",
"bytes": "97954"
}
],
"symlink_target": ""
} |
/* On my honor, I have neither given nor received unauthorized aid on this assignment */
//
// utility.h
// MIPSsim
//
// Created by Yuxing Han on 14-3-22.
// Copyright (c) 2014 Yuxing Han. All rights reserved.
//
#ifndef MIPSsim_utility_h
#define MIPSsim_utility_h
#include <assert.h>
//register label
#define REGISTER unsigned int
#define MEMORY int
#define REG_NUM 32
#define MEM_SIZE 256 // 1024/4
#define INSTRUCTION_LENGTH 32
#define INITIAL_COM_ADDR 256
#define FLAG_COM_ADDR -1
#define BREAK_CODE "01010100000000000000000000001101"
// for c_str
class cstr_compare {
public:
bool operator()(const char *l, const char * r) {
if (strcmp(l, r) < 0)
return true;
else
return false;
}
};
//print helper***************************************
#define HYPHENS "--------------------"
#define CON_PRINT_FORMAT(type,x) "%d\t%d\t%d \t%d \t%d\t%d\t%d\t%d\n",\
type[x],type[x+1],type[x+2],type[x+3], type[x+4],type[x+5],type[x+6],type[x+7]
//==print helper***************************************
//pipleline setting**********************************
#define FU_NUM 3
#define IF_SIZE 2
#define PRE_ISSUE_SIZE 4
#define PRE_ALU1_SIZE 2
#define PRE_ALU2_SIZE 2
#define PRE_MEM_SIZE 1
#define POST_MEM_SIZE 1
#define POST_ALU2_size 1
//==pipleline setting********************************
#endif
| {
"content_hash": "f1a016efe1e5bdabd6edc792753f7542",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 89,
"avg_line_length": 21.60655737704918,
"alnum_prop": 0.6039453717754173,
"repo_name": "Nathaniel1990/MIPSsim",
"id": "ede354961f3b625a68d34ed1cae22d9a3984bb15",
"size": "1318",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "prog2/src/utility.h",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "9703"
},
{
"name": "C++",
"bytes": "53471"
},
{
"name": "Shell",
"bytes": "1163"
}
],
"symlink_target": ""
} |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package uk.co.marmablue.gunboat.texture;
import uk.co.marmablue.gunboat.texture.TextureReader;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.util.HashMap;
import javax.media.opengl.GL;
import javax.media.opengl.glu.GLU;
/**
*
* @author Ian
*/
public class TextureLoader {
private HashMap textures = new HashMap();
private GL gl;
private GLU glu;
public TextureLoader(GL gl, GLU glu) {
this.gl = gl;
this.glu = glu;
loadTextures();
}
public void loadTextures() {
File dir = new File("textures/");
String[] textureFiles = dir.list(new FilenameFilter() {
@Override
public boolean accept(File file, String name) {
return (name.endsWith(".png"));
}
});
for (int i = 0; i < textureFiles.length; i++) {
int tmpTextureRef = genTexture(gl);
textures.put(textureFiles[i], Integer.valueOf(tmpTextureRef));
gl.glBindTexture(GL.GL_TEXTURE_2D, tmpTextureRef);
Texture loadedTexture = null;
try {
loadedTexture = uk.co.marmablue.gunboat.texture.TextureReader.readTexture("textures/" + textureFiles[i]);
} catch (IOException e) {
e.printStackTrace();
}
makeRGBTexture(gl, glu, loadedTexture, GL.GL_TEXTURE_2D, false);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
}
}
public int getTextureID(String textureName) {
return (Integer) textures.get(textureName+".png");
}
private static void makeRGBTexture(GL gl, GLU glu, Texture img, int target, boolean mipmapped) {
if (mipmapped) {
glu.gluBuild2DMipmaps(target, GL.GL_RGB8, img.getWidth(), img.getHeight(), GL.GL_RGB, GL.GL_UNSIGNED_BYTE, img.getPixels());
} else {
gl.glTexImage2D(target, 0, GL.GL_RGB, img.getWidth(), img.getHeight(), 0, GL.GL_RGB, GL.GL_UNSIGNED_BYTE, img.getPixels());
}
}
private static int genTexture(GL gl) {
final int[] tmp = new int[1];
gl.glGenTextures(1, tmp, 0);
return tmp[0];
}
}
| {
"content_hash": "84b5ed401427f66c14140c509342c57f",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 136,
"avg_line_length": 32.608108108108105,
"alnum_prop": 0.6108578532946539,
"repo_name": "ianrenton/Gunboat",
"id": "8eeb94e3fc9ff7146ca7e496515c96682aebdae9",
"size": "2413",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/uk/co/marmablue/gunboat/texture/TextureLoader.java",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "26"
},
{
"name": "Java",
"bytes": "109207"
},
{
"name": "Shell",
"bytes": "108"
}
],
"symlink_target": ""
} |
#ifndef DISPATCHER_H_
#define DISPATCHER_H_
// BEGIN Includes. ///////////////////////////////////////////////////
// System dependencies.
#include <cassert>
#include <vector>
#include <string>
#include <mutex>
#include <map>
// Application dependencies.
#include <ias/channel/channel.h>
// END Includes. /////////////////////////////////////////////////////
template<class T>
class Dispatcher {
public:
// BEGIN Class constants. ////////////////////////////////////////
// END Class constants. //////////////////////////////////////////
private:
// BEGIN Private members. ////////////////////////////////////////
/**
* A map which holds the channels.
*/
std::map<std::string,Channel<T> *> mChannels;
/**
* A mutex which synchronizes the channels.
*/
std::mutex mLock;
// END Private members. //////////////////////////////////////////
// BEGIN Private methods. ////////////////////////////////////////
// END Private methods. //////////////////////////////////////////
protected:
// BEGIN Protected methods. //////////////////////////////////////
// END Protected methods. ////////////////////////////////////////
public:
// BEGIN Constructors. ///////////////////////////////////////////
Dispatcher( void ){}
// END Constructors. /////////////////////////////////////////////
// BEGIN Destructor. /////////////////////////////////////////////
virtual ~Dispatcher( void ) {
for( auto it = mChannels.begin() ; it != mChannels.end() ; ++it ) {
delete it->second;
}
}
// END Destructor. ///////////////////////////////////////////////
// BEGIN Public methods. /////////////////////////////////////////
void addChannel( const std::string & identifier, Channel<T> * channel ) {
// Checking the preconditions.
assert( !identifier.empty() && channel != nullptr );
mLock.lock();
mChannels[identifier] = channel;
mLock.unlock();
}
void removeChannel( const std::string & identifier ) {
typename std::map<std::string,Channel<T> *>::iterator it;
mLock.lock();
it = mChannels.find(identifier);
if( it != mChannels.end() ) {
delete it->second;
mChannels.erase(it);
}
mLock.unlock();
}
bool containsChannel( const std::string & identifier ) {
typename std::map<std::string,Channel<T> *>::iterator it;
bool contains;
contains = false;
mLock.lock();
it = mChannels.find(identifier);
if( it != mChannels.end() )
contains = true;
mLock.unlock();
return ( contains );
}
void dispatch( const std::string & identifier , T argument ) {
typename std::map<std::string,Channel<T> *>::const_iterator it;
Channel<T> * channel;
channel = nullptr;
mLock.lock();
it = mChannels.find(identifier);
if( it != mChannels.end() ) {
channel = it->second;
}
mLock.unlock();
if( channel != nullptr ) {
channel->pipe(argument);
}
}
// END Public methods. ///////////////////////////////////////////
// BEGIN Static methods. /////////////////////////////////////////
// END Static methods. ///////////////////////////////////////////
};
#endif /* DISPATCHER_H_ */
| {
"content_hash": "c5da0dc5331d276b610271b516027d3b",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 77,
"avg_line_length": 26.476923076923075,
"alnum_prop": 0.4314352120859965,
"repo_name": "JoeriHermans/Intelligent-Automation-System",
"id": "efeb1062aefc93eee928b5c3c138ba3d9a515122",
"size": "4263",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/ias/dispatcher/dispatcher.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "5482"
},
{
"name": "C++",
"bytes": "815735"
},
{
"name": "Makefile",
"bytes": "1787"
},
{
"name": "Python",
"bytes": "26325"
},
{
"name": "Shell",
"bytes": "41"
}
],
"symlink_target": ""
} |
package io.quarkus.it.jpa.mapping.xml.modern.library_b;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
/**
* An annotated entity whose mapping is overridden in orm.xml.
*/
@Entity
public class LibraryBEntity {
@Id
private long id;
@Basic
private String name;
public LibraryBEntity() {
}
public LibraryBEntity(String name) {
this.name = name;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
} | {
"content_hash": "d06497cf7d6cfe6c800494790880f157",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 62,
"avg_line_length": 16.30952380952381,
"alnum_prop": 0.6175182481751825,
"repo_name": "quarkusio/quarkus",
"id": "79eba14bed5bc64195d8c77eabed8bdf52a27bb3",
"size": "685",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "integration-tests/jpa-mapping-xml/modern-library-b/src/main/java/io/quarkus/it/jpa/mapping/xml/modern/library_b/LibraryBEntity.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "23342"
},
{
"name": "Batchfile",
"bytes": "13096"
},
{
"name": "CSS",
"bytes": "6685"
},
{
"name": "Dockerfile",
"bytes": "459"
},
{
"name": "FreeMarker",
"bytes": "8106"
},
{
"name": "Groovy",
"bytes": "16133"
},
{
"name": "HTML",
"bytes": "1418749"
},
{
"name": "Java",
"bytes": "38584810"
},
{
"name": "JavaScript",
"bytes": "90960"
},
{
"name": "Kotlin",
"bytes": "704351"
},
{
"name": "Mustache",
"bytes": "13191"
},
{
"name": "Scala",
"bytes": "9756"
},
{
"name": "Shell",
"bytes": "71729"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="150"
android:fillAfter="false"
android:fromAlpha="1.0"
android:toAlpha="0.0" /> | {
"content_hash": "fa29d21c4c569d3dcc9247c7d37f150f",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 65,
"avg_line_length": 36.333333333333336,
"alnum_prop": 0.6788990825688074,
"repo_name": "Physer/VRIS2",
"id": "55528e2949bb31d6ff215afe78c75b5a18caa753",
"size": "218",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Client/VRIS/app/src/main/res/anim/fade_out.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "50183"
},
{
"name": "Java",
"bytes": "87705"
}
],
"symlink_target": ""
} |
namespace iox
{
namespace roudi
{
using runtime::PoshRuntime;
thread_local PoshRuntime* RuntimeTestInterface::t_activeRuntime{nullptr};
thread_local std::atomic<uint64_t> RuntimeTestInterface::t_currentRouDiContext{0};
std::atomic<uint64_t> RuntimeTestInterface::s_currentRouDiContext{0};
std::mutex RuntimeTestInterface::s_runtimeAccessMutex;
std::map<RuntimeName_t, PoshRuntime*> RuntimeTestInterface::s_runtimes;
RuntimeTestInterface::RuntimeTestInterface()
{
std::lock_guard<std::mutex> lock(RuntimeTestInterface::s_runtimeAccessMutex);
iox::cxx::Expects(PoshRuntime::getRuntimeFactory() == PoshRuntime::defaultRuntimeFactory
&& "The RuntimeTestInterface can only be used in combination with the "
"PoshRuntime::defaultRuntimeFactory! Someone else already switched the factory!");
PoshRuntime::setRuntimeFactory(RuntimeTestInterface::runtimeFactoryGetInstance);
}
RuntimeTestInterface::~RuntimeTestInterface()
{
if (m_doCleanupOnDestruction)
{
// cleanup holds its own lock
cleanupRuntimes();
std::lock_guard<std::mutex> lock(RuntimeTestInterface::s_runtimeAccessMutex);
PoshRuntime::setRuntimeFactory(PoshRuntime::defaultRuntimeFactory);
}
}
RuntimeTestInterface::RuntimeTestInterface(RuntimeTestInterface&& rhs)
{
rhs.m_doCleanupOnDestruction = false;
}
RuntimeTestInterface& RuntimeTestInterface::operator=(RuntimeTestInterface&& rhs)
{
rhs.m_doCleanupOnDestruction = false;
return *this;
}
void RuntimeTestInterface::cleanupRuntimes()
{
std::lock_guard<std::mutex> lock(RuntimeTestInterface::s_runtimeAccessMutex);
for (const auto& e : RuntimeTestInterface::s_runtimes)
{
delete e.second;
}
RuntimeTestInterface::s_runtimes.clear();
RuntimeTestInterface::s_currentRouDiContext.operator++(std::memory_order_relaxed);
}
void RuntimeTestInterface::eraseRuntime(const RuntimeName_t& name)
{
std::lock_guard<std::mutex> lock(RuntimeTestInterface::s_runtimeAccessMutex);
auto iter = RuntimeTestInterface::s_runtimes.find(name);
if (iter != RuntimeTestInterface::s_runtimes.end())
{
delete iter->second;
RuntimeTestInterface::s_runtimes.erase(name);
}
}
PoshRuntime& RuntimeTestInterface::runtimeFactoryGetInstance(cxx::optional<const RuntimeName_t*> name)
{
std::lock_guard<std::mutex> lock(RuntimeTestInterface::s_runtimeAccessMutex);
auto currentRouDiContext = RuntimeTestInterface::s_currentRouDiContext.load(std::memory_order_relaxed);
if (RuntimeTestInterface::t_currentRouDiContext.load(std::memory_order_relaxed) != currentRouDiContext)
{
RuntimeTestInterface::t_currentRouDiContext.store(currentRouDiContext, std::memory_order_relaxed);
RuntimeTestInterface::t_activeRuntime = nullptr;
}
bool nameIsNullopt{!name.has_value()};
bool invalidGetRuntimeAccess{RuntimeTestInterface::t_activeRuntime == nullptr && nameIsNullopt};
cxx::Expects(!invalidGetRuntimeAccess);
if (RuntimeTestInterface::t_activeRuntime != nullptr && nameIsNullopt)
{
return *RuntimeTestInterface::t_activeRuntime;
}
auto iter = RuntimeTestInterface::s_runtimes.find(*name.value());
if (iter != RuntimeTestInterface::s_runtimes.end())
{
RuntimeTestInterface::t_activeRuntime = iter->second;
}
else
{
auto runtimeImpl = new runtime::PoshRuntimeImpl(name, runtime::RuntimeLocation::SAME_PROCESS_LIKE_ROUDI);
RuntimeTestInterface::s_runtimes.insert({*name.value(), runtimeImpl});
RuntimeTestInterface::t_activeRuntime = runtimeImpl;
}
return *RuntimeTestInterface::t_activeRuntime;
}
} // namespace roudi
} // namespace iox
| {
"content_hash": "609ebf13a9c4c382acbecd9ba0c67a1a",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 113,
"avg_line_length": 34.583333333333336,
"alnum_prop": 0.7338688085676037,
"repo_name": "eclipse-iceoryx/iceoryx",
"id": "3fda982a1adcd38c7f5822f663cd4a93953db3d1",
"size": "4643",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "iceoryx_posh/testing/roudi_environment/runtime_test_interface.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "195601"
},
{
"name": "C++",
"bytes": "5989063"
},
{
"name": "CMake",
"bytes": "154728"
},
{
"name": "Dockerfile",
"bytes": "1953"
},
{
"name": "PowerShell",
"bytes": "2458"
},
{
"name": "Python",
"bytes": "85178"
},
{
"name": "Shell",
"bytes": "96915"
},
{
"name": "Starlark",
"bytes": "62418"
}
],
"symlink_target": ""
} |
package org.apache.qpid.proton.engine.impl.ssl;
import static org.junit.Assert.assertEquals;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.junit.Assert;
public class ByteTestHelper
{
public static void assertArrayUntouchedExcept(String expectedString, byte[] actualBytes)
{
assertArrayUntouchedExcept(expectedString, actualBytes, 0);
}
public static void assertArrayUntouchedExcept(String expectedString, byte[] actualBytes, int offset)
{
byte[] string = expectedString.getBytes();
byte[] expectedBytes = createFilledBuffer(actualBytes.length);
System.arraycopy(string, 0, expectedBytes, offset, string.length);
assertEquals(new String(expectedBytes), new String(actualBytes));
}
/**
* Intended to be used by tests to write into, allowing us to check that only the expected elements got overwritten.
* @return a byte array of the specified length containing @@@...
*/
public static byte[] createFilledBuffer(int length)
{
byte[] expectedBytes = new byte[length];
Arrays.fill(expectedBytes, (byte)'@');
return expectedBytes;
}
public static void assertByteEquals(char expectedAsChar, byte actual)
{
Assert.assertEquals((byte)expectedAsChar, actual);
}
public static void assertByteBufferContents(ByteBuffer byteBuffer, String expectedContents)
{
assertByteBufferContents(byteBuffer, expectedContents, null);
}
public static void assertByteBufferContents(ByteBuffer byteBuffer, String expectedContents, String message)
{
int expectedLimit = expectedContents.length();
assertEquals("Position of readable byte buffer should initially be zero", 0, byteBuffer.position());
assertEquals("Limit of readable byte buffer should equal length of expected contents", expectedLimit, byteBuffer.limit());
byte[] bytes = new byte[expectedLimit];
byteBuffer.get(bytes);
if(message != null)
{
assertEquals(message, expectedContents, new String(bytes));
}
else
{
assertEquals("Unexpected contents", expectedContents, new String(bytes));
}
}
}
| {
"content_hash": "2aba00e7eefc35cf68ea7639edce909f",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 130,
"avg_line_length": 33.417910447761194,
"alnum_prop": 0.6931665922286735,
"repo_name": "chirino/proton",
"id": "9a5817b58934e5dbf98c579074797ee0cd63186b",
"size": "3046",
"binary": false,
"copies": "1",
"ref": "refs/heads/trunk",
"path": "proton-j/proton/src/test/java/org/apache/qpid/proton/engine/impl/ssl/ByteTestHelper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "502370"
},
{
"name": "Java",
"bytes": "1085703"
},
{
"name": "PHP",
"bytes": "40840"
},
{
"name": "Perl",
"bytes": "28661"
},
{
"name": "Python",
"bytes": "265196"
},
{
"name": "Ruby",
"bytes": "89013"
},
{
"name": "Shell",
"bytes": "8364"
}
],
"symlink_target": ""
} |
package com.cloud.storage.template;
import com.cloud.agent.api.storage.DownloadAnswer;
import com.cloud.agent.api.to.S3TO;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.VMTemplateHostVO;
import com.cloud.storage.command.DownloadCommand;
import com.cloud.storage.resource.SecondaryStorageResource;
import com.cloud.utils.component.Manager;
import com.cloud.utils.net.Proxy;
import java.util.Map;
public interface DownloadManager extends Manager {
/**
* Initiate download of a public template
*
* @param id unique id.
* @param url the url from where to download from
* @param hvm whether the template is a hardware virtual machine
* @param accountId the accountId of the iso owner (null if public iso)
* @param descr description of the template
* @param user username used for authentication to the server
* @param password password used for authentication to the server
* @param maxDownloadSizeInBytes (optional) max download size for the template, in bytes.
* @param resourceType signifying the type of resource like template, volume etc.
* @return job-id that can be used to interrogate the status of the download.
*/
public String downloadPublicTemplate(long id, String url, String name, ImageFormat format, boolean hvm, Long accountId, String descr, String cksum,
String installPathPrefix, String templatePath, String userName, String passwd, long maxDownloadSizeInBytes, Proxy proxy, DownloadCommand
.ResourceType
resourceType);
public String downloadS3Template(S3TO s3, long id, String url, String name, ImageFormat format, boolean hvm, Long accountId, String descr, String cksum,
String installPathPrefix, String user, String password, long maxTemplateSizeInBytes, Proxy proxy, DownloadCommand.ResourceType resourceType);
Map<String, Processor> getProcessors();
/**
* Get the status of a download job
*
* @param jobId job Id
* @return status of the download job
*/
public TemplateDownloader.Status getDownloadStatus(String jobId);
/**
* Get the status of a download job
*
* @param jobId job Id
* @return status of the download job
*/
public VMTemplateHostVO.Status getDownloadStatus2(String jobId);
/**
* Get the download percent of a download job
*
* @param jobId job Id
* @return
*/
public int getDownloadPct(String jobId);
/**
* Get the download error if any
*
* @param jobId job Id
* @return
*/
public String getDownloadError(String jobId);
/**
* Get the local path for the download
* @param jobId job Id
* @return public String getDownloadLocalPath(String jobId);
*/
/**
* Handle download commands from the management server
*
* @param cmd cmd from server
* @return answer representing status of download.
*/
public DownloadAnswer handleDownloadCommand(SecondaryStorageResource resource, DownloadCommand cmd);
/**
* /**
*
* @return list of template info for installed templates
*/
public Map<String, TemplateProp> gatherTemplateInfo(String templateDir);
/**
* /**
*
* @return list of volume info for installed volumes
*/
public Map<Long, TemplateProp> gatherVolumeInfo(String volumeDir);
}
| {
"content_hash": "1b4f3945a45ca4aa7935e9ab91f34329",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 178,
"avg_line_length": 37.09090909090909,
"alnum_prop": 0.6473311546840959,
"repo_name": "remibergsma/cosmic",
"id": "6baa763d34aa638dd21064b04a13473ff18daea0",
"size": "3672",
"binary": false,
"copies": "1",
"ref": "refs/heads/play/serviceofferings",
"path": "cosmic-core/services/secondary-storage-server/src/main/java/com/cloud/storage/template/DownloadManager.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "1451"
},
{
"name": "CSS",
"bytes": "355524"
},
{
"name": "FreeMarker",
"bytes": "1832"
},
{
"name": "Groovy",
"bytes": "135777"
},
{
"name": "HTML",
"bytes": "142254"
},
{
"name": "Java",
"bytes": "19541615"
},
{
"name": "JavaScript",
"bytes": "4569018"
},
{
"name": "Python",
"bytes": "1940322"
},
{
"name": "Shell",
"bytes": "274412"
},
{
"name": "XSLT",
"bytes": "165385"
}
],
"symlink_target": ""
} |
Projects =
{
-- SeeScript
{
dir = "src/SeeScript",
type = "static",
links = { }
},
-- See
{
dir = "src/See",
type = "console",
links = { "SeeScript" }
},
-- RemoteCompiler
{
dir = "src/RemoteCompiler",
type = "console",
links = { "SeeScript" }
}
}
-- If this is empty, name of current directory will be used instead
SolutionName = ""
-- Global include dirs
IncludeDirs = { "src", "src3rd" }
-- Global library dirs
LibDirs = { }
-- Debug dir (working directory)
debugdir "data"
-----------------------------------------------------------------------------------------------------------------------
if SolutionName == "" then
SolutionName = path.getname(os.getcwd())
end
-----------------------------------------------------------------------------------------------------------------------
-- Generate named project using defined params
function generateProject(params)
local name = group().current.filename
local projectGroup = group().group
print("Generating project: " .. projectGroup .. "/" .. name)
function getParam(key, default)
local result = params[key]
if result == nil then return default end
return result
end
local _type = getParam("type", "lib")
local _language = getParam("language", "C++")
local _include_current = getParam("include_current", false)
local _name = getParam("name", "")
local _shared_macro = getParam("shared_macro", string.upper(name) .. "_BUILDING")
local _links = getParam("links", { })
local _include_dirs = getParam("include_dirs", { })
local _lib_dirs = getParam("lib_dirs", { })
local _configure_callback = getParam("configure_callback", nil)
language(_language)
if _type == "lib" then
filter { "configurations:Static*" }
kind "StaticLib"
filter { "configurations:DLL*" }
kind "SharedLib"
filter { }
elseif _type == "console" then
kind "ConsoleApp"
elseif _type == "windowed" then
kind "WindowedApp"
elseif _type == "static" then
kind "StaticLib"
elseif _type == "dynamic" then
kind "SharedLib"
elseif _type == "app" then
filter { "configurations:*Debug" }
kind "ConsoleApp"
filter { "configurations:*Release" }
kind "WindowedApp"
filter { }
end
defines { _shared_macro }
files { "**.c", "**.cc", "**.cpp", "**.h", "**.hpp", "**.inl", "**.natvis" }
if _name ~= "" then
targetname(_name)
end
links(_links)
includedirs(_include_dirs)
libdirs(_lib_dirs)
filter { }
-- Enable precompiled headers, if they exist
if os.isfile("StdAfx.h") and os.isfile("StdAfx.cpp") then
filter { "action:vs*" }
pchheader "StdAfx.h"
pchsource "StdAfx.cpp"
buildoptions { '/FI StdAfx.h' }
filter { }
end
if _configure_callback ~= nil then
_configure_callback(params)
end
end
-----------------------------------------------------------------------------------------------------------------------
solution(SolutionName)
configurations { "Debug", "Release" }
platforms { "64-bit" }
location(path.join(".build", _ACTION))
if os.isdir("R:") then
objdir(path.join("R:", ".obj"))
end
filter { "platforms:64*" }
architecture "x86_64"
filter { "configurations:*Debug" }
defines { "_DEBUG", "DEBUG" }
flags { "Symbols" }
filter { "configurations:*Release" }
defines { "_NDEBUG", "NDEBUG" }
flags { "Symbols" }
optimize "On"
filter { "system:windows", "platforms:64*" }
defines { "_WIN64", "WIN64" }
filter { "system:windows" }
defines { "_WIN32", "WIN32", "_CRT_SECURE_NO_WARNINGS", "_WIN32_WINNT=0x0601", "WINVER=0x0601", "NTDDI_VERSION=0x06010000" }
flags { "NoMinimalRebuild", "MultiProcessorCompile" }
buildoptions { '/wd"4503"', "/GR" }
if _ACTION == "vs2013" then
defines { "_MSC_VER=1800" }
elseif _ACTION == "vs2015" then
defines { "_MSC_VER=1900" }
filter { "system:windows", "configurations:DLL Debug" }
links { "ucrtd.lib", "vcruntimed.lib", "msvcrtd.lib" }
filter { "system:windows", "configurations:DLL Release" }
links { "ucrt.lib", "vcruntime.lib", "msvcrt.lib" }
filter { }
end
filter { }
buildoptions { "/std:c++latest" }
includedirs(IncludeDirs)
libdirs(LibDirs)
targetdir ".bin/%{cfg.buildcfg}"
-- Get current directory
cwd = os.getcwd()
-- Set default empty group
group ""
-- Enumerate all projects in global Projects table
for k, Project in pairs(Projects) do
if Project.dir ~= nil then
ok, err = os.chdir(Project.dir)
if ok == true then
-- Set project name
local name = k
if type(name) == "number" then
name = Project.name
end
if name == nil then
-- If name was not specified, create it from project directory name
name = path.getname(Project.dir)
end
-- Project group based on parent project directory name
group(path.getdirectory(Project.dir))
-- Set premake project context
project(name)
-- Generate project information
generateProject(Project)
-- Change directory back
os.chdir(cwd)
else
print("Could not change directory to: " .. Project.dir)
end
else
print("Project does not have a directory specified!")
end
end
| {
"content_hash": "5e3230c57d0d7cec597d7c3008a46361",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 126,
"avg_line_length": 24.68663594470046,
"alnum_prop": 0.5682284860929625,
"repo_name": "P-i-N/SeeScript",
"id": "b8360c7ab3b3799bd064bdadc771bd33316d6746",
"size": "6421",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "premake5.lua",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "460"
},
{
"name": "C",
"bytes": "98"
},
{
"name": "C++",
"bytes": "227257"
},
{
"name": "CSS",
"bytes": "2589"
},
{
"name": "HTML",
"bytes": "2469"
},
{
"name": "JavaScript",
"bytes": "7477"
},
{
"name": "Lua",
"bytes": "6421"
}
],
"symlink_target": ""
} |
Observer
========
Trading procedure has events:
* procedure publication
* applications registration is over
* applications review protocol publication
* procedure archive
Using these events we can implement:
* notify procedure participants when the application review protocol has published
* procedure events logger
| {
"content_hash": "46f42fd4ff305842dcc1e8506ed430e9",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 84,
"avg_line_length": 27.583333333333332,
"alnum_prop": 0.7794561933534743,
"repo_name": "astahovn/design-patterns",
"id": "c667e9bd730e09cb9af4d38372833fcd2f7e47f6",
"size": "331",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Behavioral/Observer/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "58985"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Amazon.SimpleNotificationService;
using Amazon.SimpleNotificationService.Model;
using Amazon.Runtime;
using ThirdParty.MD5;
namespace AWSSDK_DotNet.IntegrationTests.Utils
{
public static class UtilityMethods
{
public const string SDK_TEST_PREFIX = "aws-net-sdk";
static string _accountId;
/// <summary>
/// There is not a good way to get account id. This hack creates
/// a topic gets the account id out of the ARN and then deletes the topic.
/// </summary>
public static string AccountId
{
get
{
if(_accountId == null)
{
var createRequest = new CreateTopicRequest
{
Name = "sdk-accountid-lookup" + DateTime.Now.Ticks
};
using(var snsClient = new AmazonSimpleNotificationServiceClient())
{
var response = snsClient.CreateTopic(createRequest);
var tokens = response.TopicArn.Split(':');
_accountId = tokens[4];
snsClient.DeleteTopic(new DeleteTopicRequest { TopicArn = response.TopicArn });
}
}
return _accountId;
}
}
public static AWSCredentials CreateTemporaryCredentials()
{
using (var sts = new Amazon.SecurityToken.AmazonSecurityTokenServiceClient())
{
var creds = sts.GetSessionToken().Credentials;
return creds;
}
}
public static Stream CreateStreamFromString(string s)
{
return CreateStreamFromString(s, new MemoryStream());
}
public static Stream CreateStreamFromString(string s, Stream stream)
{
StreamWriter writer = new StreamWriter(stream);
writer.Write(s);
writer.Flush();
stream.Position = 0;
return stream;
}
public static string GetResourceText(string resourceName)
{
using (StreamReader reader = new StreamReader(GetResourceStream(resourceName)))
{
return reader.ReadToEnd();
}
}
public static Stream GetResourceStream(string resourceName)
{
Assembly assembly = typeof(UtilityMethods).Assembly;
var resource = FindResourceName(resourceName);
Stream stream = assembly.GetManifestResourceStream(resource);
return stream;
}
public static string FindResourceName(string partialName)
{
return FindResourceName(s => s.IndexOf(partialName, StringComparison.OrdinalIgnoreCase) >= 0).Single();
}
public static IEnumerable<string> FindResourceName(Predicate<string> match)
{
Assembly assembly = typeof(UtilityMethods).Assembly;
var allResources = assembly.GetManifestResourceNames();
foreach (var resource in allResources)
{
if (match(resource))
yield return resource;
}
}
/// <summary>
/// Helper function to format a byte array into string
/// </summary>
/// <param name="data">The data blob to process</param>
/// <param name="lowercase">If true, returns hex digits in lower case form</param>
/// <returns>String version of the data</returns>
public static string ToHex(byte[] data, bool lowercase)
{
var sb = new StringBuilder();
for (int i = 0; i < data.Length; i++)
{
sb.Append(data[i].ToString(lowercase ? "x2" : "X2", CultureInfo.InvariantCulture));
}
return sb.ToString();
}
public static byte[] ComputeSHA256(byte[] data)
{
return new SHA256CryptoServiceProvider().ComputeHash(data);
}
public static void CompareFiles(string file1, string file2)
{
byte[] file1MD5 = computeHash(file1);
byte[] file2MD5 = computeHash(file2);
Assert.AreEqual(file1MD5.Length, file2MD5.Length);
for (int i = 0; i < file1MD5.Length; i++)
{
Assert.AreEqual(file1MD5[i], file2MD5[i], "MD5 of files do not match");
}
}
private static byte[] computeHash(string file)
{
Stream fileStream = File.OpenRead(file);
byte[] fileMD5 = new MD5Managed().ComputeHash(fileStream);
fileStream.Close();
return fileMD5;
}
public static T WaitUntilSuccess<T>(Func<T> loadFunction, int sleepSeconds = 5, int maxWaitSeconds = 300)
{
T result = default(T);
WaitUntil(() =>
{
try
{
result = loadFunction();
return true;
}
catch
{
return false;
}
}, sleepSeconds, maxWaitSeconds);
return result;
}
public static void WaitUntilSuccess(Action action, int sleepSeconds = 5, int maxWaitSeconds = 300)
{
WaitUntil(() =>
{
try
{
action();
return true;
}
catch
{
return false;
}
}, sleepSeconds, maxWaitSeconds);
}
public static void WaitUntil(Func<bool> matchFunction, int sleepSeconds = 5, int maxWaitSeconds = 300)
{
if (sleepSeconds < 0) throw new ArgumentOutOfRangeException("sleepSeconds");
if (maxWaitSeconds < 0) throw new ArgumentOutOfRangeException("maxWaitSeconds");
var sleepTime = TimeSpan.FromSeconds(sleepSeconds);
var maxTime = TimeSpan.FromSeconds(maxWaitSeconds);
var endTime = DateTime.Now + maxTime;
while(DateTime.Now < endTime)
{
if (matchFunction())
return;
Thread.Sleep(sleepTime);
}
throw new TimeoutException(string.Format("Wait condition was not satisfied for {0} seconds", maxWaitSeconds));
}
public static void WriteFile(string path, string contents)
{
string fullPath = Path.GetFullPath(path);
new DirectoryInfo(Path.GetDirectoryName(fullPath)).Create();
File.WriteAllText(fullPath, contents);
}
public static void GenerateFile(string path, long size)
{
string contents = GenerateTestContents(size);
WriteFile(path, contents);
}
public static string GenerateTestContents(long size)
{
StringBuilder sb = new StringBuilder();
for (long i = 0; i < size; i++)
{
char c = (char)('a' + (i % 26));
sb.Append(c);
}
string contents = sb.ToString();
return contents;
}
public static string GenerateName()
{
return GenerateName(SDK_TEST_PREFIX + "-");
}
public static string GenerateName(string name)
{
return name + new Random().Next();
}
}
}
| {
"content_hash": "be283fdd648a33d310676b060c221541",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 122,
"avg_line_length": 32.94092827004219,
"alnum_prop": 0.5384910977328039,
"repo_name": "rafd123/aws-sdk-net",
"id": "2ab9e417cb067f041afcb3ead76ec6f198ebbcaa",
"size": "7809",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "sdk/test/IntegrationTests/Utils/UtilityMethods.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "85386370"
},
{
"name": "CSS",
"bytes": "18119"
},
{
"name": "HTML",
"bytes": "24352"
},
{
"name": "JavaScript",
"bytes": "6576"
},
{
"name": "PowerShell",
"bytes": "12753"
},
{
"name": "XSLT",
"bytes": "7010"
}
],
"symlink_target": ""
} |
"use strict";
/*----------------------------------------------------------------------------
** SpiceMainConn
** This is the master Javascript class for establishing and
** managing a connection to a Spice Server.
**
** Invocation: You must pass an object with properties as follows:
** uri (required) Uri of a WebSocket listener that is
** connected to a spice server.
** password (required) Password to send to the spice server
** message_id (optional) Identifier of an element in the DOM
** where SpiceConn will write messages.
** It will use classes spice-messages-x,
** where x is one of info, warning, or error.
** screen_id (optional) Identifier of an element in the DOM
** where SpiceConn will create any new
** client screens. This is the main UI.
** dump_id (optional) If given, an element to use for
** dumping every single image + canvas drawn.
** Sometimes useful for debugging.
** onerror (optional) If given, a function to receive async
** errors. Note that you should also catch
** errors for ones that occur inline
**
** Throws error if there are troubles. Requires a modern (by 2012 standards)
** browser, including WebSocket and WebSocket.binaryType == arraybuffer
**
**--------------------------------------------------------------------------*/
function SpiceMainConn()
{
if (typeof WebSocket === "undefined")
throw new Error("WebSocket unavailable. You need to use a different browser.");
SpiceConn.apply(this, arguments);
}
SpiceMainConn.prototype = Object.create(SpiceConn.prototype);
SpiceMainConn.prototype.process_channel_message = function(msg)
{
if (msg.type == SPICE_MSG_MAIN_INIT)
{
this.log_info("Connected to " + this.ws.url);
this.report_success("Connected")
this.main_init = new SpiceMsgMainInit(msg.data);
this.connection_id = this.main_init.session_id;
if (DEBUG > 0)
{
// FIXME - there is a lot here we don't handle; mouse modes, agent,
// ram_hint, multi_media_time
this.log_info("session id " + this.main_init.session_id +
" ; display_channels_hint " + this.main_init.display_channels_hint +
" ; supported_mouse_modes " + this.main_init.supported_mouse_modes +
" ; current_mouse_mode " + this.main_init.current_mouse_mode +
" ; agent_connected " + this.main_init.agent_connected +
" ; agent_tokens " + this.main_init.agent_tokens +
" ; multi_media_time " + this.main_init.multi_media_time +
" ; ram_hint " + this.main_init.ram_hint);
}
this.mouse_mode = this.main_init.current_mouse_mode;
if (this.main_init.current_mouse_mode != SPICE_MOUSE_MODE_CLIENT &&
(this.main_init.supported_mouse_modes & SPICE_MOUSE_MODE_CLIENT))
{
var mode_request = new SpiceMsgcMainMouseModeRequest(SPICE_MOUSE_MODE_CLIENT);
var mr = new SpiceMiniData();
mr.build_msg(SPICE_MSGC_MAIN_MOUSE_MODE_REQUEST, mode_request);
this.send_msg(mr);
}
var attach = new SpiceMiniData;
attach.type = SPICE_MSGC_MAIN_ATTACH_CHANNELS;
attach.size = attach.buffer_size();
this.send_msg(attach);
return true;
}
if (msg.type == SPICE_MSG_MAIN_MOUSE_MODE)
{
var mode = new SpiceMsgMainMouseMode(msg.data);
DEBUG > 0 && this.log_info("Mouse supported modes " + mode.supported_modes + "; current " + mode.current_mode);
this.mouse_mode = mode.current_mode;
if (this.inputs)
this.inputs.mouse_mode = mode.current_mode;
return true;
}
if (msg.type == SPICE_MSG_MAIN_CHANNELS_LIST)
{
var i;
var chans;
DEBUG > 0 && console.log("channels");
chans = new SpiceMsgChannels(msg.data);
for (i = 0; i < chans.channels.length; i++)
{
var conn = {
uri: this.ws.url,
parent: this,
connection_id : this.connection_id,
type : chans.channels[i].type,
chan_id : chans.channels[i].id
};
if (chans.channels[i].type == SPICE_CHANNEL_DISPLAY)
this.display = new SpiceDisplayConn(conn);
else if (chans.channels[i].type == SPICE_CHANNEL_INPUTS)
{
this.inputs = new SpiceInputsConn(conn);
this.inputs.mouse_mode = this.mouse_mode;
}
else if (chans.channels[i].type == SPICE_CHANNEL_CURSOR)
this.cursor = new SpiceCursorConn(conn);
else
{
this.log_err("Channel type " + chans.channels[i].type + " unknown.");
if (! ("extra_channels" in this))
this.extra_channels = [];
this.extra_channels[i] = new SpiceConn(conn);
}
}
return true;
}
return false;
}
SpiceMainConn.prototype.stop = function(msg)
{
this.state = "closing";
if (this.inputs)
{
this.inputs.cleanup();
this.inputs = undefined;
}
if (this.cursor)
{
this.cursor.cleanup();
this.cursor = undefined;
}
if (this.display)
{
this.display.cleanup();
this.display.destroy_surfaces();
this.display = undefined;
}
this.cleanup();
if ("extra_channels" in this)
for (var e in this.extra_channels)
this.extra_channels[e].cleanup();
this.extra_channels = undefined;
}
| {
"content_hash": "daa1de1645fbfe6cecf7a4c6ab34edf8",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 119,
"avg_line_length": 38.76875,
"alnum_prop": 0.5189424472029663,
"repo_name": "wyvernnot/noemu",
"id": "6b4e4cc98bdda2c9ee4111f5a1f7b50e86a08976",
"size": "6973",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "app/spice/main.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2882"
},
{
"name": "CSS",
"bytes": "21793"
},
{
"name": "JavaScript",
"bytes": "582110"
},
{
"name": "Python",
"bytes": "46797"
},
{
"name": "Shell",
"bytes": "3203"
}
],
"symlink_target": ""
} |
class API::V1::AliasEmailsAPI < Grape::API
include Grape::Kaminari
resource :alias_emails do
desc 'Gets an individual alias email'
params do
requires :id, type: String
end
get ':id' do
email = AliasEmail.find(params[:id])
present email, with: API::V1::AliasEmailEntity
end
desc 'Create an alias email'
params do
requires :account_email_id, type: String
requires :address, type: String
end
post do
# NOTE: We need the email object back so don't preform asynchronously here
email = Workers::CreateAliasEmail.new.perform(params[:account_email_id], params[:address])
present email, with: API::V1::AliasEmailEntity
end
end
end
| {
"content_hash": "4c6cca2814e714ad739c4d230fc6c60b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 96,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.6666666666666666,
"repo_name": "biola/google-syncinator",
"id": "93e0b58d65cf6a688cc2101371454a2af683bc27",
"size": "756",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/api/versions/v1/alias_emails_api.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "320696"
}
],
"symlink_target": ""
} |
'use strict';
const crypto = require('crypto');
const rrange = 4294967296;
/**
* Return an integer, pseudo-random number in the range [0, 2^32).
*/
const nextInt = function() {
return crypto.randomBytes(4).readUInt32BE(0);
};
/**
* Return a floating-point, pseudo-random number in the range [0, 1).
*/
const rand = function() {
return nextInt() / rrange;
};
/**
* Return an integer, pseudo-random number in the range [0, max).
*/
exports.randInt = function(max) {
return Math.floor(rand() * max);
};
| {
"content_hash": "a025bea8fabd2a19d8d2f8c78791e5a7",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 69,
"avg_line_length": 17.93103448275862,
"alnum_prop": 0.65,
"repo_name": "lpinca/binb",
"id": "ad3e774b6a15bee50e4b716c577ebc5c563a054b",
"size": "520",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/prng.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "17292"
},
{
"name": "HTML",
"bytes": "26364"
},
{
"name": "JavaScript",
"bytes": "90765"
}
],
"symlink_target": ""
} |
import os
import pickle
import datetime
import numpy as np
import tensorflow as tf
from utils import ops
from tflearn.layers import dropout
from tensorflow.contrib.tensorboard.plugins import projector
from tensorflow.contrib.rnn import stack_bidirectional_rnn
from models.model import Model
class BLSTMAcner(Model):
"""
A LSTM network for generating Named Entities given an input Sentence.
"""
def create_placeholders(self):
self.input = tf.placeholder(tf.int32,
[None, self.args.get("sequence_length")])
self.pos = tf.placeholder(tf.int32,
[None, self.args.get("sequence_length")])
self.input_lengths = tf.placeholder(tf.int32, [None])
self.output = tf.placeholder(tf.float32,
[None, self.args.get("sequence_length"),
self.args['n_classes']])
def weight_and_bias(self, in_size, out_size):
weight = tf.truncated_normal([in_size, out_size], stddev=0.01)
bias = tf.constant(0.1, shape=[out_size])
return tf.Variable(weight), tf.Variable(bias)
def cost(self):
cross_entropy = self.output * tf.log(self.prediction)
cross_entropy = -tf.reduce_sum(cross_entropy, reduction_indices=2)
mask = tf.sign(
tf.reduce_max(tf.abs(self.output), reduction_indices=2))
cross_entropy *= mask
cross_entropy = tf.reduce_sum(cross_entropy, reduction_indices=1)
cross_entropy /= tf.cast(self.input_lengths, tf.float32)
return tf.reduce_mean(cross_entropy)
def build_model(self, metadata_path=None, embedding_weights=None):
self.embedding_weights, self.config = ops.embedding_layer(metadata_path[0],
embedding_weights[0])
self.pos_embedding_weights, self.config = ops.embedding_layer(metadata_path[1],
embedding_weights[1], name='pos_embedding')
self.embedded_input = tf.nn.embedding_lookup(self.embedding_weights,
self.input)
self.embedded_pos = tf.nn.embedding_lookup(self.pos_embedding_weights,
self.pos)
self.merged_input = tf.concat([self.embedded_input, self.embedded_pos], axis=-1)
cells_fw, cells_bw =[], []
for layer in range(self.args['rnn_layers']):
cells_fw.append(tf.contrib.rnn.LSTMCell(self.args['hidden_units'],
state_is_tuple=True))
cells_bw.append(tf.contrib.rnn.LSTMCell(self.args['hidden_units'],
state_is_tuple=True))
self.rnn_output, _, _ = stack_bidirectional_rnn(cells_fw, cells_bw,
tf.unstack(tf.transpose(self.merged_input, perm=[1, 0, 2])),
dtype=tf.float32, sequence_length=self.input_lengths)
weight, bias = self.weight_and_bias(2 * self.args['hidden_units'],
self.args['n_classes'])
self.rnn_output = tf.reshape(tf.transpose(tf.stack(self.rnn_output), perm=[1, 0, 2]),
[-1, 2 * self.args['hidden_units']])
self.rnn_output = dropout(self.rnn_output, keep_prob=self.args['dropout'])
logits = tf.matmul(self.rnn_output, weight) + bias
prediction = tf.nn.softmax(logits)
self.prediction = tf.reshape(prediction, [-1, self.args.get("sequence_length"),
self.args['n_classes']])
open_targets = tf.reshape(self.output, [-1, self.args['n_classes']])
with tf.name_scope("loss"):
#self.loss = self.cost()
self.loss = tf.losses.softmax_cross_entropy(open_targets, logits)
if self.args["l2_reg_beta"] > 0.0:
self.regularizer = ops.get_regularizer(self.args["l2_reg_beta"])
self.loss = tf.reduce_mean(self.loss + self.regularizer)
with tf.name_scope('accuracy'):
self.correct_prediction = tf.equal(tf.argmax(prediction, 1),
tf.argmax(open_targets, 1))
self.accuracy = tf.reduce_mean(tf.cast(self.correct_prediction, tf.float32))
def create_scalar_summary(self, sess):
# Summaries for loss and accuracy
self.loss_summary = tf.summary.scalar("loss", self.loss)
# Train Summaries
self.train_summary_op = tf.summary.merge([self.loss_summary])
self.train_summary_writer = tf.summary.FileWriter(self.checkpoint_dir,
sess.graph)
projector.visualize_embeddings(self.train_summary_writer,
self.config)
# Dev summaries
self.dev_summary_op = tf.summary.merge([self.loss_summary])
self.dev_summary_writer = tf.summary.FileWriter(self.dev_summary_dir,
sess.graph)
def train_step(self, sess, text_batch, ne_batch, lengths_batch, pos_batch,
epochs_completed, verbose=True):
"""
A single train step
"""
feed_dict = {
self.input: text_batch,
self.output: ne_batch,
self.input_lengths: lengths_batch,
self.pos: pos_batch
}
ops = [self.tr_op_set, self.global_step,
self.loss, self.prediction, self.accuracy]
if hasattr(self, 'train_summary_op'):
ops.append(self.train_summary_op)
_, step, loss, pred, acc, summaries = sess.run(ops, feed_dict)
self.train_summary_writer.add_summary(summaries, step)
else:
_, step, loss, pred, acc = sess.run(ops, feed_dict)
if verbose:
time_str = datetime.datetime.now().isoformat()
print(("Epoch: {}\tTRAIN: {}\tCurrent Step: {}\tLoss {}\tAcc: {}"
"").format(epochs_completed, time_str, step, loss, acc))
return pred, loss, step, acc
def evaluate_step(self, sess, text_batch, ne_batch, lengths_batch, pos_batch,
verbose=True):
"""
A single evaluation step
"""
feed_dict = {
self.input: text_batch,
self.output: ne_batch,
self.input_lengths : lengths_batch,
self.pos: pos_batch
}
ops = [self.global_step, self.loss, self.prediction, self.accuracy]
if hasattr(self, 'dev_summary_op'):
ops.append(self.dev_summary_op)
step, loss, pred, acc, summaries = sess.run(ops, feed_dict)
self.dev_summary_writer.add_summary(summaries, step)
else:
step, loss, pred, acc = sess.run(ops, feed_dict)
time_str = datetime.datetime.now().isoformat()
if verbose:
print("EVAL: {}\tStep: {}\tloss: {:g}\tAcc: {}".format(
time_str, step, loss, acc))
return loss, pred, acc
| {
"content_hash": "61c8a0b21c959a19e5a9faf17202b589",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 93,
"avg_line_length": 45.64331210191083,
"alnum_prop": 0.5542841194529724,
"repo_name": "mindgarage/Ovation",
"id": "4327c5f09f2e7f70c8d42adf26bc983e2f210b8c",
"size": "7166",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "models/blstm_acner.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Jupyter Notebook",
"bytes": "5870"
},
{
"name": "Python",
"bytes": "264059"
},
{
"name": "Shell",
"bytes": "265"
}
],
"symlink_target": ""
} |
// flow-typed signature: 72dce3fe18aaac8c20c58e67527d89d0
// flow-typed version: <<STUB>>/kefir.combines_v^4.0.0/flow_v0.39.0
/**
* This is an autogenerated libdef stub for:
*
* 'kefir.combines'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/
declare module 'kefir.combines' {
declare module.exports: any;
}
/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module 'kefir.combines/dist/kefir.combines' {
declare module.exports: any;
}
declare module 'kefir.combines/dist/kefir.combines.min' {
declare module.exports: any;
}
declare module 'kefir.combines/lib/kefir.combines' {
declare module.exports: any;
}
declare module 'kefir.combines/src/kefir.combines' {
declare module.exports: any;
}
// Filename aliases
declare module 'kefir.combines/dist/kefir.combines.js' {
declare module.exports: $Exports<'kefir.combines/dist/kefir.combines'>;
}
declare module 'kefir.combines/dist/kefir.combines.min.js' {
declare module.exports: $Exports<'kefir.combines/dist/kefir.combines.min'>;
}
declare module 'kefir.combines/lib/kefir.combines.js' {
declare module.exports: $Exports<'kefir.combines/lib/kefir.combines'>;
}
declare module 'kefir.combines/src/kefir.combines.js' {
declare module.exports: $Exports<'kefir.combines/src/kefir.combines'>;
}
| {
"content_hash": "ea3506b37c41d10067440ce85adac544",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 77,
"avg_line_length": 29.62264150943396,
"alnum_prop": 0.7375796178343949,
"repo_name": "stuf/masayards-calmm",
"id": "e0a63fd087dec0033e84e3ccd2e37d8a23b38744",
"size": "1570",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "flow-typed/npm/kefir.combines_vx.x.x.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "24943"
},
{
"name": "HTML",
"bytes": "3942"
},
{
"name": "JavaScript",
"bytes": "741479"
},
{
"name": "Shell",
"bytes": "1158"
}
],
"symlink_target": ""
} |
/*!
* iCheck v2.0.0 rc1, http://git.io/arlzeA
* =======================================
* Cross-platform checkboxes and radio buttons customization
*
* (c) Damir Sultanov - http://fronteed.com
* MIT Licensed
*/
(function (win, doc, $) {
// prevent multiple includes
if (!win.ichecked) {
win.ichecked = function () {
$ = win.jQuery || win.Zepto;
// default options
var defaults = {
// auto init on domready
autoInit: true,
// auto handle ajax loaded inputs
autoAjax: false,
// remove 300ms click delay on touch devices
tap: true,
// customization class names
checkboxClass: 'icheckbox',
radioClass: 'iradio',
checkedClass: 'checked',
disabledClass: 'disabled',
indeterminateClass: 'indeterminate',
hoverClass: 'hover',
// focusClass: 'focus',
// activeClass: 'active',
// default callbacks
callbacks: {
ifCreated: false
},
// appended class names
classes: {
base: 'icheck',
div: '#-item', // {base}-item
area: '#-area-', // {base}-area-{value}
input: '#-input', // {base}-input
label: '#-label' // {base}-label
}
};
// extend default options
win.icheck = $.extend(defaults, win.icheck);
// useragent sniffing
var ua = win.navigator.userAgent;
var ie = /MSIE [5-8]/.test(ua) || doc.documentMode < 9;
var operaMini = /Opera Mini/.test(ua);
// classes cache
var baseClass = defaults.classes.base;
var divClass = defaults.classes.div.replace('#', baseClass);
var areaClass = defaults.classes.area.replace('#', baseClass);
var nodeClass = defaults.classes.input.replace('#', baseClass);
var labelClass = defaults.classes.label.replace('#', baseClass);
// unset init classes
delete defaults.classes;
// default filter
var filter = 'input[type=checkbox],input[type=radio]';
// clickable areas container
var areas = {};
// hashes container
var hashes = {};
// hash recognizer
var recognizer = new RegExp(baseClass + '\\[(.*?)\\]');
// hash extractor
var extract = function (className, matches, value) {
if (!!className) {
matches = recognizer.exec(className);
if (matches && hashes[matches[1]]) {
value = matches[1];
}
}
return value;
};
// detect computed style support
var computed = win.getComputedStyle;
// detect pointer events support
var isPointer = win.PointerEvent || win.MSPointerEvent;
// detect touch events support
var isTouch = 'ontouchend' in win;
// detect mobile users
var isMobile = /mobile|tablet|phone|ip(ad|od)|android|silk|webos/i.test(ua);
// setup events
var mouse = ['mouse', 'down', 'up', 'over', 'out']; // bubbling hover
var pointer = win.PointerEvent ? ['pointer', mouse[1], mouse[2], mouse[3], mouse[4]] : ['MSPointer', 'Down', 'Up', 'Over', 'Out'];
var touch = ['touch', 'start', 'end'];
var noMouse = (isTouch && isMobile) || isPointer;
// choose events
var hoverStart = noMouse ? (isTouch ? touch[0] + touch[1] : pointer[0] + pointer[3]) : mouse[0] + mouse[3];
var hoverEnd = noMouse ? (isTouch ? touch[0] + touch[2] : pointer[0] + pointer[4]) : mouse[0] + mouse[4];
var tapStart = noMouse ? (isTouch ? false : pointer[0] + pointer[1]) : mouse[0] + mouse[1];
var tapEnd = noMouse ? (isTouch ? false : pointer[0] + pointer[2]) : mouse[0] + mouse[2];
var hover = !operaMini ? hoverStart + '.i ' + hoverEnd + '.i ' : '';
var tap = !operaMini && tapStart ? tapStart + '.i ' + tapEnd + '.i' : '';
// styles options
var styleTag;
var styleList;
var styleArea = defaults.areaStyle !== false ? 'position:absolute;display:block;content:"";top:#;bottom:#;left:#;right:#;' : 0;
var styleInput = 'position:absolute!;display:block!;outline:none!;' + (defaults.debug ? '' : 'opacity:0!;z-index:-99!;clip:rect(0 0 0 0)!;');
// styles addition
var style = function (rules, selector, area) {
if (!styleTag) {
// create container
styleTag = doc.createElement('style');
// append to header
(doc.head || doc.getElementsByTagName('head')[0]).appendChild(styleTag);
// webkit hack
if (!win.createPopup) {
styleTag.appendChild(doc.createTextNode(''));
}
styleList = styleTag.sheet || styleTag.styleSheet;
}
// choose selector
if (!selector) {
selector = 'div.' + (area ? areaClass + area + ':after' : divClass + ' input.' + nodeClass);
}
// replace shorthand rules
rules = rules.replace(/!/g, ' !important');
// append styles
if (styleList.addRule) {
styleList.addRule(selector, rules, 0);
} else {
styleList.insertRule(selector + '{' + rules + '}', 0);
}
};
// append input's styles
style(styleInput);
// append styler's styles
if ((isTouch && isMobile) || operaMini) {
// force custor:pointer for mobile devices
style('cursor:pointer!;', 'label.' + labelClass + ',div.' + divClass);
}
// append iframe's styles
style('display:none!', 'iframe.icheck-frame'); // used to handle ajax-loaded inputs
// class toggler
var toggle = function (node, className, status, currentClass, updatedClass, addClass, removeClass) {
currentClass = node.className;
if (!!currentClass) {
updatedClass = ' ' + currentClass + ' ';
// add class
if (status === 1) {
addClass = className;
// remove class
} else if (status === 0) {
removeClass = className;
// add and remove class
} else {
addClass = className[0];
removeClass = className[1];
}
// add class
if (!!addClass && updatedClass.indexOf(' ' + addClass + ' ') < 0) {
updatedClass += addClass + ' ';
}
// remove class
if (!!removeClass && ~updatedClass.indexOf(' ' + removeClass + ' ')) {
updatedClass = updatedClass.replace(' ' + removeClass + ' ', ' ');
}
// trim class
updatedClass = updatedClass.replace(/^\s+|\s+$/g, '');
// update class
if (updatedClass !== currentClass) {
node.className = updatedClass;
}
// return updated class
return updatedClass;
}
};
// traces remover
var tidy = function (node, key, trigger, settings, className, parent) {
if (hashes[key]) {
settings = hashes[key];
className = settings.className;
parent = $(closest(node, 'div', className));
// prevent overlapping
if (parent.length) {
// input
$(node).removeClass(nodeClass + ' ' + className).attr('style', settings.style);
// label
$('label.' + settings.esc).removeClass(labelClass + ' ' + className);
// parent
$(parent).replaceWith($(node));
// callback
if (trigger) {
callback(node, key, trigger);
}
}
// unset current key
hashes[key] = false;
}
};
// nodes inspector
var inspect = function (object, node, stack, direct, indirect) {
stack = [];
direct = object.length;
// inspect object
while (direct--) {
node = object[direct];
// direct input
if (node.type) {
// checkbox or radio button
if (~filter.indexOf(node.type)) {
stack.push(node);
}
// indirect input
} else {
node = $(node).find(filter);
indirect = node.length;
while (indirect--) {
stack.push(node[indirect]);
}
}
}
return stack;
};
// parent searcher
var closest = function (node, tag, className, parent) {
while (node && node.nodeType !== 9) {
node = node.parentNode;
if (node && node.tagName == tag.toUpperCase() && ~node.className.indexOf(className)) {
parent = node;
break;
}
}
return parent;
};
// callbacks farm
var callback = function (node, key, name) {
name = 'if' + name;
// callbacks are allowed
if (!!hashes[key].callbacks) {
// indirect callback
if (hashes[key].callbacks[name] !== false) {
$(node).trigger(name);
// direct callback
if (typeof hashes[key].callbacks[name] == 'function') {
hashes[key].callbacks[name](node, hashes[key]);
}
}
}
};
// selection processor
var process = function (data, options, ajax, silent) {
// get inputs
var elements = inspect(data);
var element = elements.length;
// loop through inputs
while (element--) {
var node = elements[element];
var nodeAttr = node.attributes;
var nodeAttrCache = {};
var nodeAttrLength = nodeAttr.length;
var nodeAttrName;
var nodeAttrValue;
var nodeData = {};
var nodeDataCache = {}; // merged data
var nodeDataProperty;
var nodeId = node.id;
var nodeInherit;
var nodeInheritItem;
var nodeInheritLength;
var nodeString = node.className;
var nodeStyle;
var nodeType = node.type;
var queryData = $.cache ? $.cache[node[$.expando]] : 0; // cached data
var settings;
var key = extract(nodeString);
var keyClass;
var handle;
var styler;
var stylerClass = '';
var stylerStyle;
var area = false;
var label;
var labelDirect;
var labelIndirect;
var labelKey;
var labelString;
var labels = [];
var labelsLength;
var fastClass = win.FastClick ? ' needsclick' : '';
// parse options from HTML attributes
while (nodeAttrLength--) {
nodeAttrName = nodeAttr[nodeAttrLength].name;
nodeAttrValue = nodeAttr[nodeAttrLength].value;
if (~nodeAttrName.indexOf('data-')) {
nodeData[nodeAttrName.substr(5)] = nodeAttrValue;
}
if (nodeAttrName == 'style') {
nodeStyle = nodeAttrValue;
}
nodeAttrCache[nodeAttrName] = nodeAttrValue;
}
// parse options from jQuery or Zepto cache
if (queryData && queryData.data) {
nodeData = $.extend(nodeData, queryData.data);
}
// parse merged options
for (nodeDataProperty in nodeData) {
nodeAttrValue = nodeData[nodeDataProperty];
if (nodeAttrValue == 'true' || nodeAttrValue == 'false') {
nodeAttrValue = nodeAttrValue == 'true';
}
nodeDataCache[nodeDataProperty.replace(/checkbox|radio|class|id|label/g, function (string, position) {
return position === 0 ? string : string.charAt(0).toUpperCase() + string.slice(1);
})] = nodeAttrValue;
}
// merge options
settings = $.extend({}, defaults, win.icheck, nodeDataCache, options);
// input type filter
handle = settings.handle;
if (handle !== 'checkbox' && handle !== 'radio') {
handle = filter;
}
// prevent unwanted init
if (settings.init !== false && ~handle.indexOf(nodeType)) {
// tidy before processing
if (key) {
tidy(node, key);
}
// generate random key
while (!hashes[key]) {
key = Math.random().toString(36).substr(2, 5); // 5 symbols
if (!hashes[key]) {
keyClass = baseClass + '[' + key + ']';
break;
}
}
// prevent unwanted duplicates
delete settings.autoInit;
delete settings.autoAjax;
// save settings
settings.style = nodeStyle || '';
settings.className = keyClass;
settings.esc = keyClass.replace(/(\[|\])/g, '\\$1');
hashes[key] = settings;
// find direct label
labelDirect = closest(node, 'label', '');
if (labelDirect) {
// normalize "for" attribute
if (!!!labelDirect.htmlFor && !!nodeId) {
labelDirect.htmlFor = nodeId;
}
labels.push(labelDirect);
}
// find indirect label
if (!!nodeId) {
labelIndirect = $('label[for="' + nodeId + '"]');
// merge labels
while (labelIndirect.length--) {
label = labelIndirect[labelIndirect.length];
if (label !== labelDirect) {
labels.push(label);
}
}
}
// loop through labels
labelsLength = labels.length;
while (labelsLength--) {
label = labels[labelsLength];
labelString = label.className;
labelKey = extract(labelString);
// remove previous key
if (labelKey) {
labelString = toggle(label, baseClass + '[' + labelKey + ']', 0);
} else {
labelString = (!!labelString ? labelString + ' ' : '') + labelClass;
}
// update label's class
label.className = labelString + ' ' + keyClass + fastClass;
}
// prepare styler
styler = doc.createElement('div');
// parse inherited options
if (!!settings.inherit) {
nodeInherit = settings.inherit.split(/\s*,\s*/);
nodeInheritLength = nodeInherit.length;
while (nodeInheritLength--) {
nodeInheritItem = nodeInherit[nodeInheritLength];
if (nodeAttrCache[nodeInheritItem] !== undefined) {
if (nodeInheritItem == 'class') {
stylerClass += nodeAttrCache[nodeInheritItem] + ' ';
} else {
styler.setAttribute(nodeInheritItem, nodeInheritItem == 'id' ? baseClass + '-' + nodeAttrCache[nodeInheritItem] : nodeAttrCache[nodeInheritItem]);
}
}
}
}
// set input's type class
stylerClass += settings[nodeType + 'Class'];
// set styler's key
stylerClass += ' ' + divClass + ' ' + keyClass;
// append area styles
if (settings.area && styleArea) {
area = ('' + settings.area).replace(/%|px|em|\+|-/g, '') | 0;
if (area) {
// append area's styles
if (!areas[area]) {
style(styleArea.replace(/#/g, '-' + area + '%'), false, area);
areas[area] = true;
}
stylerClass += ' ' + areaClass + area;
}
}
// update styler's class
styler.className = stylerClass + fastClass;
// update node's class
node.className = (!!nodeString ? nodeString + ' ' : '') + nodeClass + ' ' + keyClass;
// replace node
node.parentNode.replaceChild(styler, node);
// append node
styler.appendChild(node);
// append additions
if (!!settings.insert) {
$(styler).append(settings.insert);
}
// set relative position
if (area) {
// get styler's position
if (computed) {
stylerStyle = computed(styler, null).getPropertyValue('position');
} else {
stylerStyle = styler.currentStyle.position;
}
// update styler's position
if (stylerStyle == 'static') {
styler.style.position = 'relative';
}
}
// operate
operate(node, styler, key, 'updated', true, false, ajax);
hashes[key].done = true;
// ifCreated callback
if (!silent) {
callback(node, key, 'Created');
}
}
}
};
// operations center
var operate = function (node, parent, key, method, silent, before, ajax) {
var settings = hashes[key];
var states = {};
var changes = {};
// current states
states.checked = [node.checked, 'Checked', 'Unchecked'];
if ((!before || ajax) && method !== 'click') {
states.disabled = [node.disabled, 'Disabled', 'Enabled'];
states.indeterminate = [node.getAttribute('indeterminate') == 'true' || !!node.indeterminate, 'Indeterminate', 'Determinate'];
}
// methods
if (method == 'updated' || method == 'click') {
changes.checked = before ? !states.checked[0] : states.checked[0];
if ((!before || ajax) && method !== 'click') {
changes.disabled = states.disabled[0];
changes.indeterminate = states.indeterminate[0];
}
} else if (method == 'checked' || method == 'unchecked') {
changes.checked = method == 'checked';
} else if (method == 'disabled' || method == 'enabled') {
changes.disabled = method == 'disabled';
} else if (method == 'indeterminate' || method == 'determinate') {
changes.indeterminate = method !== 'determinate';
// "toggle" method
} else {
changes.checked = !states.checked[0];
}
// apply changes
change(node, parent, states, changes, key, settings, method, silent, before, ajax);
};
// state changer
var change = function (node, parent, states, changes, key, settings, method, silent, before, ajax, loop) {
var type = node.type;
var typeCapital = type == 'radio' ? 'Radio' : 'Checkbox';
var property;
var value;
var classes;
var inputClass;
var label;
var labelClass = 'LabelClass';
var form;
var radios;
var radiosLength;
var radio;
var radioKey;
var radioStates;
var radioChanges;
var changed;
var toggled;
// check parent
if (!parent) {
parent = closest(node, 'div', settings.className);
}
// continue if parent exists
if (parent) {
// detect changes
for (property in changes) {
value = changes[property];
// update node's property
if (states[property][0] !== value && method !== 'updated' && method !== 'click') {
node[property] = value;
}
// update ajax attributes
if (ajax) {
if (value) {
node.setAttribute(property, property);
} else {
node.removeAttribute(property);
}
}
// update key's property
if (settings[property] !== value) {
settings[property] = value;
changed = true;
if (property == 'checked') {
toggled = true;
// find assigned radios
if (!loop && value && (!!hashes[key].done || ajax) && type == 'radio' && !!node.name) {
form = closest(node, 'form', '');
radios = 'input[name="' + node.name + '"]';
radios = form && !ajax ? $(form).find(radios) : $(radios);
radiosLength = radios.length;
while (radiosLength--) {
radio = radios[radiosLength];
radioKey = extract(radio.className);
// toggle radios
if (node !== radio && hashes[radioKey] && hashes[radioKey].checked) {
radioStates = {checked: [true, 'Checked', 'Unchecked']};
radioChanges = {checked: false};
change(radio, false, radioStates, radioChanges, radioKey, hashes[radioKey], 'updated', silent, before, ajax, true);
}
}
}
}
// cache classes
classes = [
settings[property + 'Class'], // 0, example: checkedClass
settings[property + typeCapital + 'Class'], // 1, example: checkedCheckboxClass
settings[states[property][1] + 'Class'], // 2, example: uncheckedClass
settings[states[property][1] + typeCapital + 'Class'], // 3, example: uncheckedCheckboxClass
settings[property + labelClass] // 4, example: checkedLabelClass
];
// value == false
inputClass = [classes[3] || classes[2], classes[1] || classes[0]];
// value == true
if (value) {
inputClass.reverse();
}
// update parent's class
toggle(parent, inputClass);
// update labels's class
if (!!settings.mirror && !!classes[4]) {
label = $('label.' + settings.esc);
while (label.length--) {
toggle(label[label.length], classes[4], value ? 1 : 0);
}
}
// callback
if (!silent || loop) {
callback(node, key, states[property][value ? 1 : 2]); // ifChecked or ifUnchecked
}
}
}
// additional callbacks
if (!silent || loop) {
if (changed) {
callback(node, key, 'Changed'); // ifChanged
}
if (toggled) {
callback(node, key, 'Toggled'); // ifToggled
}
}
// cursor addition
if (!!settings.cursor && !isMobile) {
// 'pointer' for enabled
if (!settings.disabled && !settings.pointer) {
parent.style.cursor = 'pointer';
settings.pointer = true;
// 'default' for disabled
} else if (settings.disabled && settings.pointer) {
parent.style.cursor = 'default';
settings.pointer = false;
}
}
// update settings
hashes[key] = settings;
}
};
// plugin definition
$.fn.icheck = function (options, fire) {
// detect methods
if (/^(checked|unchecked|indeterminate|determinate|disabled|enabled|updated|toggle|destroy|data|styler)$/.test(options)) {
var items = inspect(this);
var itemsLength = items.length;
// loop through inputs
while (itemsLength--) {
var item = items[itemsLength];
var key = extract(item.className);
if (key) {
// 'data' method
if (options == 'data') {
return hashes[key];
// 'styler' method
} else if (options == 'styler') {
return closest(item, 'div', hashes[key].className);
} else {
if (options == 'destroy') {
tidy(item, key, 'Destroyed');
} else {
operate(item, false, key, options);
}
// callback
if (typeof fire == 'function') {
fire(item);
}
}
}
}
// basic setup
} else if (typeof options == 'object' || !options) {
process(this, options || {});
}
// chain
return this;
};
// cached last key
var lastKey;
// bind label and styler
$(doc).on('click.i ' + hover + tap, 'label.' + labelClass + ',div.' + divClass, function (event) {
var self = this;
var key = extract(self.className);
if (key) {
var emitter = event.type;
var settings = hashes[key];
var className = settings.esc; // escaped class name
var div = self.tagName == 'DIV';
var input;
var target;
var partner;
var activate;
var states = [
['label', settings.activeLabelClass, settings.hoverLabelClass],
['div', settings.activeClass, settings.hoverClass]
];
// reverse array
if (div) {
states.reverse();
}
// active state
if (emitter == tapStart || emitter == tapEnd) {
// toggle self's active class
if (!!states[0][1]) {
toggle(self, states[0][1], emitter == tapStart ? 1 : 0);
}
// toggle partner's active class
if (!!settings.mirror && !!states[1][1]) {
partner = $(states[1][0] + '.' + className);
while (partner.length--) {
toggle(partner[partner.length], states[1][1], emitter == tapStart ? 1 : 0);
}
}
// fast click
if (div && emitter == tapEnd && !!settings.tap && isMobile && isPointer && !operaMini) {
activate = true;
}
// hover state
} else if (emitter == hoverStart || emitter == hoverEnd) {
// toggle self's hover class
if (!!states[0][2]) {
toggle(self, states[0][2], emitter == hoverStart ? 1 : 0);
}
// toggle partner's hover class
if (!!settings.mirror && !!states[1][2]) {
partner = $(states[1][0] + '.' + className);
while (partner.length--) {
toggle(partner[partner.length], states[1][2], emitter == hoverStart ? 1 : 0);
}
}
// fast click
if (div && emitter == hoverEnd && !!settings.tap && isMobile && isTouch && !operaMini) {
activate = true;
}
// click
} else if (div) {
if (!(isMobile && (isTouch || isPointer)) || !!!settings.tap || operaMini) {
activate = true;
}
}
// trigger input's click
if (activate) {
// currentTarget hack
setTimeout(function () {
target = event.currentTarget || {};
if (target.tagName !== 'LABEL') {
if (!settings.change || (+new Date() - settings.change > 100)) {
input = $(self).find('input.' + className).click();
if (ie || operaMini) {
input.change();
}
}
}
}, 2);
}
}
// bind input
}).on('click.i change.i focusin.i focusout.i keyup.i keydown.i', 'input.' + nodeClass, function (event) {
var self = this;
var key = extract(self.className);
if (key) {
var emitter = event.type;
var settings = hashes[key];
var className = settings.esc; // escaped class name
var parent = emitter == 'click' ? false : closest(self, 'div', settings.className);
var label;
var states;
// click
if (emitter == 'click') {
hashes[key].change = +new Date();
// prevent event bubbling to parent
event.stopPropagation();
// change
} else if (emitter == 'change') {
if (parent && !self.disabled) {
operate(self, parent, key, 'click'); // 'click' method
}
// focus state
} else if (~emitter.indexOf('focus')) {
states = [settings.focusClass, settings.focusLabelClass];
// toggle parent's focus class
if (!!states[0] && parent) {
toggle(parent, states[0], emitter == 'focusin' ? 1 : 0);
}
// toggle label's focus class
if (!!settings.mirror && !!states[1]) {
label = $('label.' + className);
while (label.length--) {
toggle(label[label.length], states[1], emitter == 'focusin' ? 1 : 0);
}
}
// keyup or keydown (event fired before state is changed, except Opera 9-12)
} else if (parent && !self.disabled) {
// keyup
if (emitter == 'keyup') {
// spacebar or arrow
if (self.type == 'checkbox' && event.keyCode == 32 && settings.keydown || self.type == 'radio' && !self.checked) {
operate(self, parent, key, 'click', false, true); // 'toggle' method
}
hashes[key].keydown = false;
hashes[lastKey] && (hashes[lastKey].keydown = false);
// keydown
} else {
lastKey = key;
hashes[key].keydown = true;
}
}
}
// domready
}).ready(function () {
// auto init
if (win.icheck.autoInit) {
$('.' + baseClass).icheck();
}
// auto ajax
if (win.jQuery) {
// body selector cache
var body = doc.body || doc.getElementsByTagName('body')[0];
// apply converter
$.ajaxSetup({
converters: {
'text html': function (data) {
if (win.icheck.autoAjax && body) {
var frame = doc.createElement('iframe'); // create container
var frameData;
// set attributes
if (!ie) {
frame.style = 'display:none';
}
frame.className = 'iframe.icheck-frame';
frame.src = 'about:blank';
// append container to document
body.appendChild(frame);
// save container's content
frameData = frame.contentDocument ? frame.contentDocument : frame.contentWindow.document;
// append data to content
frameData.open();
frameData.write(data);
frameData.close();
// remove container from document
body.removeChild(frame);
// setup object
frameData = $(frameData);
// customize inputs
process(frameData.find('.' + baseClass), {}, true);
// extract HTML
frameData = frameData[0];
data = (frameData.body || frameData.getElementsByTagName('body')[0]).innerHTML;
frameData = null; // prevent memory leaks
}
return data;
}
}
});
}
});
};
// expose iCheck as an AMD module
if (typeof define == 'function' && define.amd) {
define('icheck', [win.jQuery ? 'jquery' : 'zepto'], win.ichecked);
} else {
win.ichecked();
}
}
}(window, document));
| {
"content_hash": "c41f5371b1aa064912fbeae48b64ed15",
"timestamp": "",
"source": "github",
"line_count": 1032,
"max_line_length": 186,
"avg_line_length": 39.64437984496124,
"alnum_prop": 0.3779238872729939,
"repo_name": "cloudtp/Cloud-Portal",
"id": "3526f5654997e1a0650db7f6a9aa5404a357d26a",
"size": "40913",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "static/js/icheck.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "906510"
},
{
"name": "HTML",
"bytes": "1896101"
},
{
"name": "JavaScript",
"bytes": "3727006"
},
{
"name": "PHP",
"bytes": "1684"
},
{
"name": "Python",
"bytes": "74927"
},
{
"name": "Ruby",
"bytes": "981"
},
{
"name": "Shell",
"bytes": "1314"
}
],
"symlink_target": ""
} |
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/networksecurity/v1beta1/server_tls_policy.proto
package com.google.cloud.networksecurity.v1beta1;
public interface UpdateServerTlsPolicyRequestOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.networksecurity.v1beta1.UpdateServerTlsPolicyRequest)
com.google.protobuf.MessageOrBuilder {
/**
*
*
* <pre>
* Optional. Field mask is used to specify the fields to be overwritten in the
* ServerTlsPolicy resource by the update. The fields
* specified in the update_mask are relative to the resource, not
* the full request. A field will be overwritten if it is in the
* mask. If the user does not provide a mask then all fields will be
* overwritten.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the updateMask field is set.
*/
boolean hasUpdateMask();
/**
*
*
* <pre>
* Optional. Field mask is used to specify the fields to be overwritten in the
* ServerTlsPolicy resource by the update. The fields
* specified in the update_mask are relative to the resource, not
* the full request. A field will be overwritten if it is in the
* mask. If the user does not provide a mask then all fields will be
* overwritten.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The updateMask.
*/
com.google.protobuf.FieldMask getUpdateMask();
/**
*
*
* <pre>
* Optional. Field mask is used to specify the fields to be overwritten in the
* ServerTlsPolicy resource by the update. The fields
* specified in the update_mask are relative to the resource, not
* the full request. A field will be overwritten if it is in the
* mask. If the user does not provide a mask then all fields will be
* overwritten.
* </pre>
*
* <code>.google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder();
/**
*
*
* <pre>
* Required. Updated ServerTlsPolicy resource.
* </pre>
*
* <code>
* .google.cloud.networksecurity.v1beta1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return Whether the serverTlsPolicy field is set.
*/
boolean hasServerTlsPolicy();
/**
*
*
* <pre>
* Required. Updated ServerTlsPolicy resource.
* </pre>
*
* <code>
* .google.cloud.networksecurity.v1beta1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*
* @return The serverTlsPolicy.
*/
com.google.cloud.networksecurity.v1beta1.ServerTlsPolicy getServerTlsPolicy();
/**
*
*
* <pre>
* Required. Updated ServerTlsPolicy resource.
* </pre>
*
* <code>
* .google.cloud.networksecurity.v1beta1.ServerTlsPolicy server_tls_policy = 2 [(.google.api.field_behavior) = REQUIRED];
* </code>
*/
com.google.cloud.networksecurity.v1beta1.ServerTlsPolicyOrBuilder getServerTlsPolicyOrBuilder();
}
| {
"content_hash": "e5f86463df6cee50d98e07e90139ee37",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 123,
"avg_line_length": 31.133333333333333,
"alnum_prop": 0.6791067604772102,
"repo_name": "googleapis/java-network-security",
"id": "3c39b0ab6da0d2c46628962e9451432c00152b4b",
"size": "3863",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "proto-google-cloud-network-security-v1beta1/src/main/java/com/google/cloud/networksecurity/v1beta1/UpdateServerTlsPolicyRequestOrBuilder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "801"
},
{
"name": "Java",
"bytes": "4065251"
},
{
"name": "Python",
"bytes": "787"
},
{
"name": "Shell",
"bytes": "20471"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project abortOnError="false" name="PolicyEngineInteractions" resourceRoot="${projectDir}" runType="SEQUENTIAL" soapui-version="4.5.1" activeEnvironment="Default" xmlns:con="http://eviware.com/soapui/config">
<con:settings>
</con:settings>
<con:interface anonymous="optional" bindingName="{urn:gov:hhs:fha:nhinc:adapterpolicyengine}AdapterPolicyEngineBindingSoap" definition="${projectDir}/../ValidationSuite/target/wsdl/AdapterPolicyEngine.wsdl" name="AdapterPolicyEngineBindingSoap" soapVersion="1_2" type="wsdl" wsaVersion="NONE" xsi:type="con:WsdlInterface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<con:settings/>
<con:endpoints>
<con:endpoint>http://localhost:${HttpDefaultPort}/NhinConnect/AdapterPolicyEngine</con:endpoint>
</con:endpoints>
<con:operation action="urn:CheckPolicy" anonymous="optional" bindingOperationName="CheckPolicy" inputName="CheckPolicyRequest" isOneWay="false" name="CheckPolicy" outputName="CheckPolicyResponse" receivesAttachments="false" sendsAttachments="false" type="Request-Response">
<con:settings/>
</con:operation>
</con:interface>
<con:interface anonymous="optional" bindingName="{urn:gov:hhs:fha:nhinc:nhincproxydocretrieve}NhincProxyDocRetrieveBindingSoap" definition="${projectDir}/../ValidationSuite/target/wsdl/NhincProxyDocRetrieve.wsdl" name="NhincProxyDocRetrieveBindingSoap" soapVersion="1_2" type="wsdl" wsaVersion="NONE" xsi:type="con:WsdlInterface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<con:settings/>
<con:endpoints>
<con:endpoint>${#Project#NhincProxyDocRetrieveEndpoint}</con:endpoint>
<con:endpoint>http://localhost:${HttpDefaultPort}/NhinConnect/NhincProxyDocRetrieve</con:endpoint>
</con:endpoints>
<con:operation action="urn:RespondingGateway_CrossGatewayRetrieve" anonymous="optional" bindingOperationName="RespondingGateway_CrossGatewayRetrieve" inputName="RespondingGateway_CrossGatewayRetrieveRequest" isOneWay="false" name="RespondingGateway_CrossGatewayRetrieve" outputName="RespondingGateway_CrossGatewayRetrieveResponse" receivesAttachments="false" sendsAttachments="false" type="Request-Response">
<con:settings/>
</con:operation>
</con:interface>
<con:interface anonymous="optional" bindingName="{urn:gov:hhs:fha:nhinc:nhincproxydocquery}NhincProxyDocQueryBindingSoap" definition="${projectDir}/../ValidationSuite/target/wsdl/NhincProxyDocQuery.wsdl" name="NhincProxyDocQueryBindingSoap" soapVersion="1_2" type="wsdl" wsaVersion="NONE" xsi:type="con:WsdlInterface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<con:settings/>
<con:endpoints>
<con:endpoint>http://localhost:${HttpDefaultPort}/NhinConnect/NhincProxyDocQuery</con:endpoint>
</con:endpoints>
<con:operation action="urn:RespondingGateway_CrossGatewayQuery" anonymous="optional" bindingOperationName="RespondingGateway_CrossGatewayQuery" inputName="RespondingGateway_CrossGatewayQueryRequest" isOneWay="false" name="RespondingGateway_CrossGatewayQuery" outputName="RespondingGateway_CrossGatewayQueryResponse" receivesAttachments="false" sendsAttachments="false" type="Request-Response">
<con:settings/>
</con:operation>
</con:interface>
<con:interface anonymous="optional" bindingName="{urn:gov:hhs:fha:nhinc:nhincinternalcomponentpolicyenginetransform}NhincInternalComponentPolicyEngineTransformPortTypeBinding" definition="${projectDir}/../ValidationSuite/target/wsdl/NhincComponentInternalPolicyEngineTransform.wsdl" name="NhincInternalComponentPolicyEngineTransformPortTypeBinding" soapVersion="1_2" type="wsdl" wsaVersion="NONE" xsi:type="con:WsdlInterface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<con:settings/>
<con:endpoints>
<con:endpoint>http://localhost:${NhincHttpPort}/NhinConnect/PolicyEngineGatewayTransformationService</con:endpoint>
<con:endpoint>http://localhost:8080/NhinConnect/PolicyEngineGatewayTransformationService</con:endpoint>
<con:endpoint>http://172.16.50.47:8080/NhinConnect/PolicyEngineGatewayTransformationService</con:endpoint>
</con:endpoints>
<con:operation action="urn:TransformAdhocQueryResultToCheckPolicy" anonymous="optional" bindingOperationName="TransformAdhocQueryResultToCheckPolicy" inputName="TransformAdhocQueryResultToCheckPolicyRequest" isOneWay="false" name="TransformAdhocQueryResultToCheckPolicy" outputName="TransformAdhocQueryResultToCheckPolicyResponse" receivesAttachments="false" sendsAttachments="false" type="Request-Response">
<con:settings/>
</con:operation>
<con:operation action="urn:TransformAdhocQueryToCheckPolicy" anonymous="optional" bindingOperationName="TransformAdhocQueryToCheckPolicy" inputName="TransformAdhocQueryToCheckPolicyRequest" isOneWay="false" name="TransformAdhocQueryToCheckPolicy" outputName="TransformAdhocQueryToCheckPolicyResponse" receivesAttachments="false" sendsAttachments="false" type="Request-Response">
<con:settings/>
</con:operation>
<con:operation action="urn:TransformDocRetrieveResultToCheckPolicy" anonymous="optional" bindingOperationName="TransformDocRetrieveResultToCheckPolicy" inputName="TransformDocRetrieveResultToCheckPolicyRequest" isOneWay="false" name="TransformDocRetrieveResultToCheckPolicy" outputName="TransformDocRetrieveResultToCheckPolicyResponse" receivesAttachments="false" sendsAttachments="false" type="Request-Response">
<con:settings/>
</con:operation>
<con:operation action="urn:TransformDocRetrieveToCheckPolicy" anonymous="optional" bindingOperationName="TransformDocRetrieveToCheckPolicy" inputName="TransformDocRetrieveToCheckPolicyRequest" isOneWay="false" name="TransformDocRetrieveToCheckPolicy" outputName="TransformDocRetrieveToCheckPolicyResponse" receivesAttachments="false" sendsAttachments="false" type="Request-Response">
<con:settings/>
</con:operation>
<con:operation action="urn:TransformFindAuditEventsToCheckPolicy" anonymous="optional" bindingOperationName="TransformFindAuditEventsToCheckPolicy" inputName="TransformFindAuditEventsToCheckPolicyRequest" isOneWay="false" name="TransformFindAuditEventsToCheckPolicy" outputName="TransformFindAuditEventsToCheckPolicyResponse" receivesAttachments="false" sendsAttachments="false" type="Request-Response">
<con:settings/>
</con:operation>
<con:operation action="urn:TransformNotifyToCheckPolicy" anonymous="optional" bindingOperationName="TransformNotifyToCheckPolicy" inputName="TransformNotifyToCheckPolicyRequest" isOneWay="false" name="TransformNotifyToCheckPolicy" outputName="TransformNotifyToCheckPolicyResponse" receivesAttachments="false" sendsAttachments="false" type="Request-Response">
<con:settings/>
</con:operation>
<con:operation action="urn:TransformSubjectAddedToCheckPolicy" anonymous="optional" bindingOperationName="TransformSubjectAddedToCheckPolicy" inputName="TransformSubjectAddedToCheckPolicyRequest" isOneWay="false" name="TransformSubjectAddedToCheckPolicy" outputName="TransformSubjectAddedToCheckPolicyResponse" receivesAttachments="false" sendsAttachments="false" type="Request-Response">
<con:settings/>
</con:operation>
<con:operation action="urn:TransformSubjectRevisedToCheckPolicy" anonymous="optional" bindingOperationName="TransformSubjectRevisedToCheckPolicy" inputName="TransformSubjectRevisedToCheckPolicyRequest" isOneWay="false" name="TransformSubjectRevisedToCheckPolicy" outputName="TransformSubjectRevisedToCheckPolicyResponse" receivesAttachments="false" sendsAttachments="false" type="Request-Response">
<con:settings/>
</con:operation>
<con:operation action="urn:TransformSubscribeToCheckPolicy" anonymous="optional" bindingOperationName="TransformSubscribeToCheckPolicy" inputName="TransformSubscribeToCheckPolicyRequest" isOneWay="false" name="TransformSubscribeToCheckPolicy" outputName="TransformSubscribeToCheckPolicyResponse" receivesAttachments="false" sendsAttachments="false" type="Request-Response">
<con:settings/>
</con:operation>
<con:operation action="urn:TransformUnsubscribeToCheckPolicy" anonymous="optional" bindingOperationName="TransformUnsubscribeToCheckPolicy" inputName="TransformUnsubscribeToCheckPolicyRequest" isOneWay="false" name="TransformUnsubscribeToCheckPolicy" outputName="TransformUnsubscribeToCheckPolicyResponse" receivesAttachments="false" sendsAttachments="false" type="Request-Response">
<con:settings/>
</con:operation>
</con:interface>
<con:testSuite name="PolicyEngineInteractions TestSuite">
<con:settings/>
<con:runType>SEQUENTIAL</con:runType>
<con:testCase disabled="true" failOnError="true" failTestCaseOnErrors="true" id="5cab5713-e464-44b8-a43f-d29dad6b57b1" keepSession="false" maxResults="0" name="doc query message to DTE" searchProperties="true">
<con:settings/>
<con:testStep name="message" type="request">
<con:settings/>
<con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<con:interface>NhincInternalComponentPolicyEngineTransformPortTypeBinding</con:interface>
<con:operation>TransformAdhocQueryToCheckPolicy</con:operation>
<con:request name="message">
<con:settings/>
<con:encoding>UTF-8</con:encoding>
<con:endpoint>http://172.16.50.47:8080/NhinConnect/PolicyEngineGatewayTransformationService</con:endpoint>
<con:request><![CDATA[
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:gov:hhs:fha:nhinc:common:policyenginedte" xmlns:urn1="urn:gov:hhs:fha:nhinc:common:eventcommon" xmlns:urn2="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:urn3="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:urn4="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:urn5="urn:gov:hhs:fha:nhinc:common:nhinccommon">
<soapenv:Header/>
<soapenv:Body>
<urn:TransformAdhocQueryToCheckPolicyRequest>
<ec:message xmlns:ec="urn:gov:hhs:fha:nhinc:common:eventcommon" xmlns:urn="urn:gov:hhs:fha:nhinc:common:nhinccommonproxy" xmlns:urn1="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:urn2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:urn3="urn:gov:hhs:fha:nhinc:common:nhinccommon" xmlns:add="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:urn6="urn:gov:hhs:fha:nhinc:common:eventcommon">
<urn1:AdhocQueryRequest federated="false" startIndex="0" maxResults="-1" xmlns:urn7="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0">
<urn1:ResponseOption returnType="RegistryObject" returnComposedObjects="false"/>
<urn2:AdhocQuery home="urn:oid:1.1" id="urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d">
<urn2:Slot name="$XDSDocumentEntryStatus">
<urn2:ValueList>
<urn2:Value>('urn:oasis:names:tc:ebxml-regrep:StatusType:Approved')</urn2:Value>
</urn2:ValueList>
</urn2:Slot>
<urn2:Slot name="$XDSDocumentEntryPatientId">
<urn2:ValueList>
<urn2:Value>'D123401^^^&2.16.840.1.113883.3.198.1&ISO'</urn2:Value>
</urn2:ValueList>
</urn2:Slot>
</urn2:AdhocQuery>
</urn1:AdhocQueryRequest>
<ec:assertion>
<urn3:address>
<urn3:addressType>
<urn3:code>W</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:addressType>
<urn3:city>BUFFALO</urn3:city>
<urn3:country>USA</urn3:country>
<urn3:state>NY</urn3:state>
<urn3:streetAddress>12345 EAST COAST WAY</urn3:streetAddress>
<urn3:zipCode>01010</urn3:zipCode>
</urn3:address>
<urn3:dateOfBirth>19800516</urn3:dateOfBirth>
<urn3:explanationNonClaimantSignature>NEEDED</urn3:explanationNonClaimantSignature>
<urn3:haveSecondWitnessSignature>true</urn3:haveSecondWitnessSignature>
<urn3:haveSignature>true</urn3:haveSignature>
<urn3:haveWitnessSignature>true</urn3:haveWitnessSignature>
<urn3:homeCommunity>
<urn3:description>Federal - VA</urn3:description>
<urn3:homeCommunityId>2.16.840.1.113883.3.200</urn3:homeCommunityId>
<urn3:name>Federal - VA</urn3:name>
</urn3:homeCommunity>
<urn3:personName>
<urn3:familyName>JONES</urn3:familyName>
<urn3:givenName>FRED</urn3:givenName>
<urn3:nameType>
<urn3:code>G</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:nameType>
<urn3:secondNameOrInitials>ANDREW</urn3:secondNameOrInitials>
<urn3:fullName/>
</urn3:personName>
<urn3:phoneNumber>
<urn3:areaCode>703</urn3:areaCode>
<urn3:countryCode>1</urn3:countryCode>
<urn3:extension>1212</urn3:extension>
<urn3:localNumber>555</urn3:localNumber>
<urn3:phoneNumberType>
<urn3:code>W</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:phoneNumberType>
</urn3:phoneNumber>
<urn3:secondWitnessAddress>
<urn3:addressType>
<urn3:code>W</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:addressType>
<urn3:city>ALBANY</urn3:city>
<urn3:country>USA</urn3:country>
<urn3:state>NY</urn3:state>
<urn3:streetAddress>4 TROY STREET</urn3:streetAddress>
<urn3:zipCode>01033</urn3:zipCode>
</urn3:secondWitnessAddress>
<urn3:secondWitnessName>
<urn3:familyName>JONES</urn3:familyName>
<urn3:givenName>JAMES</urn3:givenName>
<urn3:nameType>
<urn3:code>G</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:nameType>
<urn3:secondNameOrInitials>KENNETH</urn3:secondNameOrInitials>
<urn3:fullName/>
</urn3:secondWitnessName>
<urn3:secondWitnessPhone>
<urn3:areaCode>301</urn3:areaCode>
<urn3:countryCode>1</urn3:countryCode>
<urn3:extension>555</urn3:extension>
<urn3:localNumber>0001</urn3:localNumber>
<urn3:phoneNumberType>
<urn3:code>W</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:phoneNumberType>
</urn3:secondWitnessPhone>
<urn3:SSN>123456789</urn3:SSN>
<urn3:uniquePatientId>500000000</urn3:uniquePatientId>
<urn3:witnessAddress>
<urn3:addressType>
<urn3:code>H</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:addressType>
<urn3:city>HARTFORD</urn3:city>
<urn3:country>USA</urn3:country>
<urn3:state>CT</urn3:state>
<urn3:streetAddress>10410 MAIN ST.</urn3:streetAddress>
<urn3:zipCode>05032</urn3:zipCode>
</urn3:witnessAddress>
<urn3:witnessName>
<urn3:familyName>COREY</urn3:familyName>
<urn3:givenName>AMANDA</urn3:givenName>
<urn3:nameType>
<urn3:code>H</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:nameType>
<urn3:secondNameOrInitials>EVE</urn3:secondNameOrInitials>
<urn3:fullName/>
</urn3:witnessName>
<urn3:witnessPhone>
<urn3:areaCode>202</urn3:areaCode>
<urn3:countryCode>1</urn3:countryCode>
<urn3:extension>555</urn3:extension>
<urn3:localNumber>1010</urn3:localNumber>
<urn3:phoneNumberType>
<urn3:code>H</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:phoneNumberType>
</urn3:witnessPhone>
<urn3:userInfo>
<urn3:personName>
<urn3:familyName>FRANKLIN</urn3:familyName>
<urn3:givenName>MARK</urn3:givenName>
<urn3:nameType>
<urn3:code>P</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:nameType>
<urn3:secondNameOrInitials>ALAN</urn3:secondNameOrInitials>
<urn3:fullName/>
</urn3:personName>
<urn3:userName>mfranklin</urn3:userName>
<urn3:org>
<urn3:description>Federal - VA</urn3:description>
<urn3:homeCommunityId>2.16.840.1.113883.3.200</urn3:homeCommunityId>
<urn3:name>Federal - VA</urn3:name>
</urn3:org>
<urn3:roleCoded>
<urn3:code>80584001</urn3:code>
<urn3:codeSystem>2.16.840.1.113883.6.96</urn3:codeSystem>
<urn3:codeSystemName>SNOMED_CT</urn3:codeSystemName>
<urn3:codeSystemVersion>1.0</urn3:codeSystemVersion>
<urn3:displayName>Psychiatrist</urn3:displayName>
<urn3:originalText>Psychiatrist</urn3:originalText>
</urn3:roleCoded>
</urn3:userInfo>
<urn3:authorized>true</urn3:authorized>
<urn3:purposeOfDisclosureCoded>
<urn3:code>PSYCHOTHERAPY</urn3:code>
<urn3:codeSystem>2.16.840.1.113883.3.18.7.1</urn3:codeSystem>
<urn3:codeSystemName>nhin-purpose</urn3:codeSystemName>
<urn3:codeSystemVersion>1.0</urn3:codeSystemVersion>
<urn3:displayName>Use or disclosure of Psychotherapy Notes</urn3:displayName>
<urn3:originalText>Psychotherapy Notes</urn3:originalText>
</urn3:purposeOfDisclosureCoded>
<!--urn3:claimFormRef>Ref-Clm-123</urn3:claimFormRef-->
<!--urn3:claimFormRaw>YWVvbGlhbQ==</urn3:claimFormRaw-->
<urn3:samlAuthnStatement>
<urn3:authInstant>myAuthInstant</urn3:authInstant>
<urn3:sessionIndex>mySessionIndex</urn3:sessionIndex>
<urn3:authContextClassRef>myContextClassRef</urn3:authContextClassRef>
<urn3:subjectLocalityAddress>mySubjectLocalityAddress</urn3:subjectLocalityAddress>
<urn3:subjectLocalityDNSName>mySubjectLocalityDns</urn3:subjectLocalityDNSName>
</urn3:samlAuthnStatement>
<urn3:samlAuthzDecisionStatement>
<urn3:decision>myAuthzDecisionStatementDecision</urn3:decision>
<urn3:resource>myAuthzDecisionStatementResource</urn3:resource>
<urn3:action>myAuthzDecisionStatementAction</urn3:action>
<urn3:evidence>
<urn3:assertion>
<urn3:id>AuthzDecisionStatementEvidenceAssertionId</urn3:id>
<urn3:issueInstant>AuthzDecisionStatementEvidenceAssertionIssueInstant</urn3:issueInstant>
<urn3:version>AuthzDecisionStatementEvidenceAssertionVersion</urn3:version>
<urn3:issuer>AuthzDecisionStatementEvidenceAssertionIssuer</urn3:issuer>
<urn3:conditions>
<urn3:notBefore>2001-01-01T01:00:00.000Z</urn3:notBefore>
<urn3:notOnOrAfter>2005-05-06T22:00:17.000Z</urn3:notOnOrAfter>
</urn3:conditions>
</urn3:assertion>
</urn3:evidence>
</urn3:samlAuthzDecisionStatement>
</ec:assertion>
</ec:message>
<urn1:direction xmlns:urn6="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0">INBOUND</urn1:direction>
<urn1:interface xmlns:urn6="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0">NHIN</urn1:interface>
<urn1:sendingHomeCommunity xmlns:urn6="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0">
<urn5:description>1.1</urn5:description>
<urn5:homeCommunityId>1.1</urn5:homeCommunityId>
<urn5:name>1.1</urn5:name>
</urn1:sendingHomeCommunity>
<urn1:receivingHomeCommunity xmlns:urn6="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0">
<urn5:description>2.2</urn5:description>
<urn5:homeCommunityId>2.2</urn5:homeCommunityId>
<urn5:name>2.2</urn5:name>
</urn1:receivingHomeCommunity>
</urn:TransformAdhocQueryToCheckPolicyRequest>
</soapenv:Body>
</soapenv:Envelope>]]></con:request>
<con:assertion type="SOAP Response"/>
<con:assertion type="SOAP Fault Assertion"/>
<con:assertion name="AuthnStatementAuthnInstant " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking authInstant');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthnStatement/nc:authInstant"];
log.info('AssertionValue=' + AssertionValue);
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthnStatement/nc:authInstant)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:auth-instant']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:auth-instant']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:auth-instant'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthnStatementSessionIndex" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking sessionIndex');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthnStatement/nc:sessionIndex"];
log.info('AssertionValue=' + AssertionValue);
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthnStatement/nc:sessionIndex)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:session-index']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:session-index']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:session-index'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthnStatementAthnContextClassRef " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking authContextClassRef');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthnStatement/nc:authContextClassRef"];
log.info('AssertionValue=' + AssertionValue);
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthnStatement/nc:authContextClassRef)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:auth-context-class-ref']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:auth-context-class-ref']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:auth-context-class-ref'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthnStatementSubjectLocalityAddress " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking subjectLocalityAddress');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthnStatement/nc:subjectLocalityAddress"];
log.info('AssertionValue=' + AssertionValue);
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthnStatement/nc:subjectLocalityAddress)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:oasis:names:tc:xacml:1.0:subject:authn-locality:ip-address']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:oasis:names:tc:xacml:1.0:subject:authn-locality:ip-address']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:oasis:names:tc:xacml:1.0:subject:authn-locality:ip-address'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthnStatementDNSName " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking subjectLocalityDNSName');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthnStatement/nc:subjectLocalityDNSName"];
log.info('AssertionValue=' + AssertionValue);
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthnStatement/nc:subjectLocalityDNSName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:oasis:names:tc:xacml:1.0:subject:authn-locality:dns-name']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:oasis:names:tc:xacml:1.0:subject:authn-locality:dns-name']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:oasis:names:tc:xacml:1.0:subject:authn-locality:dns-name'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserPersonName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking username (personname)');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:userInfo/nc:userName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:oasis:names:tc:xacml:1.0:subject:subject-id'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:userInfo/nc:userName"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:oasis:names:tc:xacml:1.0:subject:subject-id']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:oasis:names:tc:xacml:1.0:subject:subject-id']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserOrganizationName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking user organization');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:userInfo/nc:org/nc:name)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-organization-name'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:userInfo/nc:org/nc:name"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-organization-name']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-organization-name']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserRoleCode" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking user role coded');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:userInfo/nc:roleCoded/nc:code)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code'])"];
log.info('XacmlAttributeCount='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:userInfo/nc:roleCoded/nc:code"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserRoleCodeSystem " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking user role system');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystem)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystem"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserRoleCodeSystemName " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking user role system name');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystemName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system-name'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystemName"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system-name']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system-name']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserRoleCodeDiplayName " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking user role display name');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:userInfo/nc:roleCoded/nc:displayName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-description'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:userInfo/nc:roleCoded/nc:displayName"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-description']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-description']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PurposeForUseCode" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('PurposeForUseCode');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:purposeOfDisclosureCoded/nc:code)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:purposeOfDisclosureCoded/nc:code"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PurposeForUseCodeSystem" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('PurposeForUseCodeSystem');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystem)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystem"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PurposeForUseCodeSystemName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('PurposeForUseCodeSystemName');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystemName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system-name'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystemName"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system-name']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system-name']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PurposeForUseCodeDisplayName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('PurposeForUseCodeDisplayName');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:purposeOfDisclosureCoded/nc:displayName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-display-name'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:purposeOfDisclosureCoded/nc:displayName"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-display-name']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-display-name']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementDecision" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementDecision');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:decision)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-decision'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:decision"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-decision']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-decision']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementResource" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementResource');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:resource)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:resource"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementAction" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementAction');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:action)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-action'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:action"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-action']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-action']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionID " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionID');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:id)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-id'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:id"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-id']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-id']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionIssueInstant" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionIssueInstant');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issueInstant)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issue-instant'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issueInstant"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issue-instant']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issue-instant']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionVersion" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionVersion');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:version)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-version'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:version"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-version']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-version']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionIssuer" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionIssuer');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issuer)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issuer'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issuer"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issuer']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issuer']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionConditionsNotBefore" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionConditionsNotBefore');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notBefore)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-before'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notBefore"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-before']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-before']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#date';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionConditionsNotOnOrAfter " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionConditionsNotOnOrAfter');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notOnOrAfter)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-on-or-after'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notOnOrAfter"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-on-or-after']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-on-or-after']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#date';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionContentReference " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionContentReference');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentReference)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-reference'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentReference"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-reference']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-reference']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionContentType " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionContentType');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentType)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-type'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentType"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-type']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-type']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionContent " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionContent');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:content)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-asssertion-content'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:content"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-asssertion-content']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-asssertion-content']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#base64Binary';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:credentials><con:authType>Global HTTP Settings</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/>
<con:wsrmConfig version="1.2"/>
</con:request>
</con:config>
</con:testStep>
<con:properties/>
<con:reportParameters/>
<con:tearDownScript>FileUtils.restoreToMasterConfiguration(context, log);</con:tearDownScript>
</con:testCase>
<con:testCase disabled="true" failOnError="true" failTestCaseOnErrors="true" id="9e80a120-6047-4f37-a42b-50a7662c76ff" keepSession="false" maxResults="0" name="doc query message to DTE - minimal data" searchProperties="true">
<con:settings/>
<con:testStep name="message - empty assertion" type="request">
<con:settings/>
<con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<con:interface>NhincInternalComponentPolicyEngineTransformPortTypeBinding</con:interface>
<con:operation>TransformAdhocQueryToCheckPolicy</con:operation>
<con:request name="message - empty assertion">
<con:settings/>
<con:encoding>UTF-8</con:encoding>
<con:endpoint>http://localhost:8080/NhinConnect/PolicyEngineGatewayTransformationService</con:endpoint>
<con:request><![CDATA[
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:gov:hhs:fha:nhinc:common:policyenginedte" xmlns:urn1="urn:gov:hhs:fha:nhinc:common:eventcommon" xmlns:urn2="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:urn3="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:urn4="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:urn5="urn:gov:hhs:fha:nhinc:common:nhinccommon">
<soapenv:Header/>
<soapenv:Body>
<urn:TransformAdhocQueryToCheckPolicyRequest>
<ec:message xmlns:ec="urn:gov:hhs:fha:nhinc:common:eventcommon" xmlns:urn="urn:gov:hhs:fha:nhinc:common:nhinccommonproxy" xmlns:urn1="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:urn2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:urn3="urn:gov:hhs:fha:nhinc:common:nhinccommon" xmlns:add="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:urn6="urn:gov:hhs:fha:nhinc:common:eventcommon">
<urn1:AdhocQueryRequest federated="false" startIndex="0" maxResults="-1" xmlns:urn7="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0">
<urn1:ResponseOption returnType="RegistryObject" returnComposedObjects="false"/>
<urn2:AdhocQuery home="urn:oid:1.1" id="urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d">
<urn2:Slot name="$XDSDocumentEntryStatus">
<urn2:ValueList>
<urn2:Value>('urn:oasis:names:tc:ebxml-regrep:StatusType:Approved')</urn2:Value>
</urn2:ValueList>
</urn2:Slot>
<urn2:Slot name="$XDSDocumentEntryPatientId">
<urn2:ValueList>
<urn2:Value>'D123401^^^&2.16.840.1.113883.3.198.1&ISO'</urn2:Value>
</urn2:ValueList>
</urn2:Slot>
</urn2:AdhocQuery>
</urn1:AdhocQueryRequest>
<ec:assertion>
</ec:assertion>
</ec:message>
<urn1:direction xmlns:urn6="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0">INBOUND</urn1:direction>
<urn1:interface xmlns:urn6="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0">NHIN</urn1:interface>
<urn1:sendingHomeCommunity xmlns:urn6="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0">
<urn5:description>1.1</urn5:description>
<urn5:homeCommunityId>1.1</urn5:homeCommunityId>
<urn5:name>1.1</urn5:name>
</urn1:sendingHomeCommunity>
<urn1:receivingHomeCommunity xmlns:urn6="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0">
<urn5:description>2.2</urn5:description>
<urn5:homeCommunityId>2.2</urn5:homeCommunityId>
<urn5:name>2.2</urn5:name>
</urn1:receivingHomeCommunity>
</urn:TransformAdhocQueryToCheckPolicyRequest>
</soapenv:Body>
</soapenv:Envelope>]]></con:request>
<con:assertion type="SOAP Response"/>
<con:assertion type="SOAP Fault Assertion"/>
<con:credentials><con:authType>Global HTTP Settings</con:authType></con:credentials><con:wsaConfig mustUnderstand="NONE" version="200508"/>
<con:wsrmConfig version="1.2"/>
</con:request>
</con:config>
</con:testStep>
<con:properties/>
<con:reportParameters/>
<con:tearDownScript>FileUtils.restoreToMasterConfiguration(context, log);</con:tearDownScript>
</con:testCase>
<con:testCase disabled="true" failOnError="true" failTestCaseOnErrors="true" id="28268c77-a4a8-4a48-a708-69768213b7ff" keepSession="false" maxResults="0" name="inbound doc query" searchProperties="true">
<con:settings/>
<con:testStep name="update config" type="groovy">
<con:settings/>
<con:config>
<script>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
def destConfigFileLocation = context.findProperty("GatewayConfigurationDirectory");
FileUtils.UpdateProperty(destConfigFileLocation,"gateway.properties","serviceDocumentQuery","true",context,log);
FileUtils.UpdateProperty(destConfigFileLocation,"gateway.properties","localHomeCommunityId","1.1",context,log);
FileUtils.CreateOrUpdateConnection(destConfigFileLocation,"1.1","policyengineservice","http://localhost:18081/mockPolicyEngine",context,log);
</script>
</con:config>
</con:testStep>
<con:testStep name="send request" type="request">
<con:settings/>
<con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<con:interface>NhincProxyDocQueryBindingSoap</con:interface>
<con:operation>RespondingGateway_CrossGatewayQuery</con:operation>
<con:request name="send request">
<con:settings/>
<con:encoding>UTF-8</con:encoding>
<con:endpoint>${#Project#NhincProxyDocQueryEndpoint}</con:endpoint>
<con:request><![CDATA[
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:gov:hhs:fha:nhinc:common:nhinccommonproxy" xmlns:urn1="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:urn2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:urn3="urn:gov:hhs:fha:nhinc:common:nhinccommon" xmlns:add="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soapenv:Header/>
<soapenv:Body>
<urn:RespondingGateway_CrossGatewayQueryRequest xsi:schemaLocation="urn:gov:hhs:fha:nhinc:common:nhinccommonproxy C:\projects\NHINC\2.3\Product\Production\Common\Interfaces\src\schemas\nhinc\common\NhincCommonProxy.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<urn1:AdhocQueryRequest federated="false" startIndex="0" maxResults="-1">
<urn1:ResponseOption returnType="RegistryObject" returnComposedObjects="false"/>
<urn2:AdhocQuery home="urn:oid:1.1" id="urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d">
<urn2:Slot name="$XDSDocumentEntryStatus">
<urn2:ValueList>
<urn2:Value>('urn:oasis:names:tc:ebxml-regrep:StatusType:Approved')</urn2:Value>
</urn2:ValueList>
</urn2:Slot>
<urn2:Slot name="$XDSDocumentEntryPatientId">
<urn2:ValueList>
<urn2:Value>'D123401^^^&1.1&ISO'</urn2:Value>
</urn2:ValueList>
</urn2:Slot>
</urn2:AdhocQuery>
</urn1:AdhocQueryRequest>
<urn:assertion>
<urn3:address>
<urn3:addressType>
<urn3:code>W</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:addressType>
<urn3:city>BUFFALO</urn3:city>
<urn3:country>USA</urn3:country>
<urn3:state>NY</urn3:state>
<urn3:streetAddress>12345 EAST COAST WAY</urn3:streetAddress>
<urn3:zipCode>01010</urn3:zipCode>
</urn3:address>
<urn3:dateOfBirth>19800516</urn3:dateOfBirth>
<urn3:explanationNonClaimantSignature>NEEDED</urn3:explanationNonClaimantSignature>
<urn3:haveSecondWitnessSignature>true</urn3:haveSecondWitnessSignature>
<urn3:haveSignature>true</urn3:haveSignature>
<urn3:haveWitnessSignature>true</urn3:haveWitnessSignature>
<urn3:homeCommunity xmlns:urn1="urn:gov:hhs:fha:nhinc:common:nhinccommon">
<urn3:description>Federal - VA</urn3:description>
<urn3:homeCommunityId>2.2</urn3:homeCommunityId>
<urn3:name>Federal - VA</urn3:name>
</urn3:homeCommunity>
<urn3:personName>
<urn3:familyName>JONES</urn3:familyName>
<urn3:givenName>FRED</urn3:givenName>
<urn3:nameType>
<urn3:code>G</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:nameType>
<urn3:secondNameOrInitials>ANDREW</urn3:secondNameOrInitials>
<urn3:fullName/>
</urn3:personName>
<urn3:phoneNumber>
<urn3:areaCode>703</urn3:areaCode>
<urn3:countryCode>1</urn3:countryCode>
<urn3:extension>1212</urn3:extension>
<urn3:localNumber>555</urn3:localNumber>
<urn3:phoneNumberType>
<urn3:code>W</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:phoneNumberType>
</urn3:phoneNumber>
<urn3:secondWitnessAddress>
<urn3:addressType>
<urn3:code>W</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:addressType>
<urn3:city>ALBANY</urn3:city>
<urn3:country>USA</urn3:country>
<urn3:state>NY</urn3:state>
<urn3:streetAddress>4 TROY STREET</urn3:streetAddress>
<urn3:zipCode>01033</urn3:zipCode>
</urn3:secondWitnessAddress>
<urn3:secondWitnessName>
<urn3:familyName>JONES</urn3:familyName>
<urn3:givenName>JAMES</urn3:givenName>
<urn3:nameType>
<urn3:code>G</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:nameType>
<urn3:secondNameOrInitials>KENNETH</urn3:secondNameOrInitials>
<urn3:fullName/>
</urn3:secondWitnessName>
<urn3:secondWitnessPhone>
<urn3:areaCode>301</urn3:areaCode>
<urn3:countryCode>1</urn3:countryCode>
<urn3:extension>555</urn3:extension>
<urn3:localNumber>0001</urn3:localNumber>
<urn3:phoneNumberType>
<urn3:code>W</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:phoneNumberType>
</urn3:secondWitnessPhone>
<urn3:SSN>123456789</urn3:SSN>
<urn3:uniquePatientId xmlns:urn1="urn:gov:hhs:fha:nhinc:common:nhinccommon">500000000^^^&1.1&ISO</urn3:uniquePatientId>
<urn3:witnessAddress>
<urn3:addressType>
<urn3:code>H</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:addressType>
<urn3:city>HARTFORD</urn3:city>
<urn3:country>USA</urn3:country>
<urn3:state>CT</urn3:state>
<urn3:streetAddress>10410 MAIN ST.</urn3:streetAddress>
<urn3:zipCode>05032</urn3:zipCode>
</urn3:witnessAddress>
<urn3:witnessName>
<urn3:familyName>COREY</urn3:familyName>
<urn3:givenName>AMANDA</urn3:givenName>
<urn3:nameType>
<urn3:code>H</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:nameType>
<urn3:secondNameOrInitials>EVE</urn3:secondNameOrInitials>
<urn3:fullName/>
</urn3:witnessName>
<urn3:witnessPhone>
<urn3:areaCode>202</urn3:areaCode>
<urn3:countryCode>1</urn3:countryCode>
<urn3:extension>555</urn3:extension>
<urn3:localNumber>1010</urn3:localNumber>
<urn3:phoneNumberType>
<urn3:code>H</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:phoneNumberType>
</urn3:witnessPhone>
<urn3:userInfo>
<urn3:personName>
<urn3:familyName>FRANKLIN</urn3:familyName>
<urn3:givenName>MARK</urn3:givenName>
<urn3:nameType>
<urn3:code>P</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:nameType>
<urn3:secondNameOrInitials>ALAN</urn3:secondNameOrInitials>
<urn3:fullName/>
</urn3:personName>
<urn3:userName>mfranklin</urn3:userName>
<urn3:org>
<urn3:description>Federal - VA</urn3:description>
<urn3:homeCommunityId>2.2</urn3:homeCommunityId>
<urn3:name>Federal - VA</urn3:name>
</urn3:org>
<urn3:roleCoded>
<urn3:code>80584001</urn3:code>
<urn3:codeSystem>2.16.840.1.113883.6.96</urn3:codeSystem>
<urn3:codeSystemName>SNOMED_CT</urn3:codeSystemName>
<urn3:codeSystemVersion>1.0</urn3:codeSystemVersion>
<urn3:displayName>Psychiatrist</urn3:displayName>
<urn3:originalText>Psychiatrist</urn3:originalText>
</urn3:roleCoded>
</urn3:userInfo>
<urn3:authorized>true</urn3:authorized>
<urn3:purposeOfDisclosureCoded>
<urn3:code>PSYCHOTHERAPY</urn3:code>
<urn3:codeSystem>2.16.840.1.113883.3.18.7.1</urn3:codeSystem>
<urn3:codeSystemName>nhin-purpose</urn3:codeSystemName>
<urn3:codeSystemVersion>1.0</urn3:codeSystemVersion>
<urn3:displayName>Use or disclosure of Psychotherapy Notes</urn3:displayName>
<urn3:originalText>Psychotherapy Notes</urn3:originalText>
</urn3:purposeOfDisclosureCoded>
<!--urn3:claimFormRef>Ref-Clm-123</urn3:claimFormRef-->
<!--urn3:claimFormRaw>YWVvbGlhbQ==</urn3:claimFormRaw-->
<urn3:samlAuthnStatement>
<urn3:authInstant>2009-09-01T13:00:00.000Z</urn3:authInstant>
<urn3:sessionIndex>mySessionIndex</urn3:sessionIndex>
<urn3:authContextClassRef>myContextClassRef</urn3:authContextClassRef>
<urn3:subjectLocalityAddress>mySubjectLocalityAddress</urn3:subjectLocalityAddress>
<urn3:subjectLocalityDNSName>mySubjectLocalityDns</urn3:subjectLocalityDNSName>
</urn3:samlAuthnStatement>
<urn3:samlAuthzDecisionStatement>
<urn3:decision>Permit</urn3:decision>
<urn3:resource>myAuthzDecisionStatementResource</urn3:resource>
<urn3:action>myAuthzDecisionStatementAction</urn3:action>
<urn3:evidence>
<urn3:assertion>
<urn3:id>AuthzDecisionStatementEvidenceAssertionId</urn3:id>
<urn3:issueInstant>2009-09-02T14:00:00.000Z</urn3:issueInstant>
<urn3:version>2.0</urn3:version>
<urn3:issuer>CN=Mr Saml User,OU=SU,O=Mr SAML Org,L=Chantilly,ST=VA,C=US</urn3:issuer>
<urn3:issuerFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</urn3:issuerFormat>
<urn3:conditions>
<urn3:notBefore>2001-01-01T01:00:00.000Z</urn3:notBefore>
<urn3:notOnOrAfter>2005-05-06T22:00:17.000Z</urn3:notOnOrAfter>
</urn3:conditions>
<urn3:accessConsentPolicy>urn:oid:1.2.3.4</urn3:accessConsentPolicy>
<urn3:instanceAccessConsentPolicy>urn:oid:1.2.3.4.123456789</urn3:instanceAccessConsentPolicy>
</urn3:assertion>
</urn3:evidence>
</urn3:samlAuthzDecisionStatement>
</urn:assertion>
<!-- <urn:nhinTargetSystem>
<urn3:url>https://localhost:8181/CONNECTNhinServicesWeb/NhinService/RespondingGateway_Query_Service/DocQuery</urn3:url>
</urn:nhinTargetSystem> -->
<urn:nhinTargetSystem>
<urn2:homeCommunity>
<urn2:description>localmachine</urn2:description>
<urn2:homeCommunityId>1.1</urn2:homeCommunityId>
<urn2:name>localmachine</urn2:name>
</urn2:homeCommunity>
</urn:nhinTargetSystem>
</urn:RespondingGateway_CrossGatewayQueryRequest>
</soapenv:Body>
</soapenv:Envelope>]]></con:request>
<con:assertion type="SOAP Response"/>
<con:assertion type="SOAP Fault Assertion"/>
<con:assertion disabled="true" name="UserRoleCodeSystem " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking user role system');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystem)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystem"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="UserRoleCodeSystemName " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking user role system name');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystemName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system-name'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystemName"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system-name']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system-name']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="UserRoleCodeDiplayName " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking user role display name');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:userInfo/nc:roleCoded/nc:displayName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-description'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:userInfo/nc:roleCoded/nc:displayName"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-description']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-description']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="PurposeForUseCode" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('PurposeForUseCode');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:purposeOfDisclosureCoded/nc:code)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:purposeOfDisclosureCoded/nc:code"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="PurposeForUseCodeSystem" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('PurposeForUseCodeSystem');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystem)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystem"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="PurposeForUseCodeSystemName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('PurposeForUseCodeSystemName');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystemName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system-name'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystemName"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system-name']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system-name']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="PurposeForUseCodeDisplayName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('PurposeForUseCodeDisplayName');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:purposeOfDisclosureCoded/nc:displayName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-display-name'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:purposeOfDisclosureCoded/nc:displayName"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-display-name']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-display-name']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementDecision" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementDecision');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:decision)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-decision'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:decision"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-decision']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-decision']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementResource" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementResource');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:resource)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:resource"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementAction" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementAction');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:action)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-action'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:action"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-action']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-action']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionID " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionID');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:id)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-id'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:id"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-id']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-id']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionIssueInstant" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionIssueInstant');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issueInstant)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issue-instant'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issueInstant"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issue-instant']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issue-instant']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionVersion" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionVersion');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:version)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-version'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:version"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-version']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-version']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionIssuer" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionIssuer');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issuer)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issuer'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issuer"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issuer']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issuer']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionConditionsNotBefore" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionConditionsNotBefore');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notBefore)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-before'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notBefore"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-before']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-before']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#date';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionConditionsNotOnOrAfter " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionConditionsNotOnOrAfter');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notOnOrAfter)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-on-or-after'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notOnOrAfter"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-on-or-after']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-on-or-after']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#date';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionContentReference " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionContentReference');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentReference)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-reference'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentReference"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-reference']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-reference']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionContentType " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionContentType');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentType)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-type'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentType"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-type']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-type']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionContent " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionContent');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:content)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-asssertion-content'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:content"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-asssertion-content']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-asssertion-content']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#base64Binary';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:credentials><con:authType>Global HTTP Settings</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/>
<con:wsrmConfig version="1.2"/>
</con:request>
</con:config>
</con:testStep>
<con:testStep name="mock policy engine" type="mockresponse">
<con:settings/>
<con:config startStep="send request" xsi:type="con:MockResponseStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<con:interface>AdapterPolicyEngineBindingSoap</con:interface>
<con:operation>CheckPolicy</con:operation>
<con:path>/mockPolicyEngine</con:path>
<con:port>18081</con:port>
<con:timeout>30000</con:timeout>
<con:response>
<con:settings/>
<con:responseContent><![CDATA[
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:gov:hhs:fha:nhinc:common:nhinccommonadapter" xmlns:urn1="urn:oasis:names:tc:xacml:2.0:context:schema:os">
<soapenv:Header/>
<soapenv:Body>
<urn:CheckPolicyResponse>
<urn:response>
<urn1:Result>
<urn1:Decision>deny</urn1:Decision>
</urn1:Result>
</urn:response>
</urn:CheckPolicyResponse>
</soapenv:Body>
</soapenv:Envelope>]]></con:responseContent>
<con:wsaConfig mustUnderstand="NONE" version="200508"/>
</con:response>
<con:assertion name="AuthnStatementAuthnInstant " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='authInstant';
def AssertionXpath='//ec:assertion/nc:samlAuthnStatement/nc:authInstant'
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:auth-instant';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthnStatementSessionIndex" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='sessionIndex';
def AssertionXpath='//ec:assertion/nc:samlAuthnStatement/nc:sessionIndex';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:session-index';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthnStatementAthnContextClassRef " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='authContextClassRef';
def AssertionXpath='//ec:assertion/nc:samlAuthnStatement/nc:authContextClassRef';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:auth-context-class-ref';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthnStatementSubjectLocalityAddress " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='subjectLocalityAddress';
def AssertionXpath='//ec:assertion/nc:samlAuthnStatement/nc:subjectLocalityAddress';
def XacmlAttributeId='urn:oasis:names:tc:xacml:1.0:subject:authn-locality:ip-address';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthnStatementDNSName " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='subjectLocalityDNSName';
def AssertionXpath='//ec:assertion/nc:samlAuthnStatement/nc:subjectLocalityDNSName';
def XacmlAttributeId='urn:oasis:names:tc:xacml:1.0:subject:authn-locality:dns-name';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserPersonName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='personname';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:userName';
def XacmlAttributeId='urn:oasis:names:tc:xacml:1.0:subject:subject-id';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserOrganizationName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='user organization';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:org/nc:name';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:user-organization-name';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserRoleCode" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='user role coded';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:roleCoded/nc:code';
//def XacmlAttributeId='urn:gov:hhs:fha:nhinc:user-role-code';
def XacmlAttributeId='urn:oasis:names:tc:xacml:2.0:subject:role';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserRoleCodeSystem " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='user role system';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystem';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserRoleCodeSystemName " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='user role system name';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystemName';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system-name';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserRoleCodeDiplayName " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='user role display name';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:roleCoded/nc:displayName';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:user-role-description';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PurposeForUseCode" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='PurposeForUseCode';
def AssertionXpath='//ec:assertion/nc:purposeOfDisclosureCoded/nc:code';
//def XacmlAttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code';
def XacmlAttributeId='urn:oasis:names:tc:xspa:1.0:subject:purposeofuse';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PurposeForUseCodeSystem" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='PurposeForUseCodeSystem';
def AssertionXpath='//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystem';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PurposeForUseCodeSystemName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='PurposeForUseCodeSystemName';
def AssertionXpath='//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystemName';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system-name';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PurposeForUseCodeDisplayName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='PurposeForUseCodeDisplayName';
def AssertionXpath='//ec:assertion/nc:purposeOfDisclosureCoded/nc:displayName';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-display-name';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementDecision" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementDecision';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:decision';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-decision';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementResource" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementResource';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:resource';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementAction" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementAction';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:action';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-action';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
//log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
def ExpectedValue='Execute';
//log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (ExpectedValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionID " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionID';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:id';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-id';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionIssueInstant" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionIssueInstant';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issueInstant';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issue-instant';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionVersion" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionVersion';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:version';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-version';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionIssuer" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionIssuer';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issuer';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issuer';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionConditionsNotBefore" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionConditionsNotBefore';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notBefore';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-before';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
//assert (AssertionValue==XacmlValue);
assert (XacmlValue == '2001-01-01T06:00:00.000Z')
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#date';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionConditionsNotOnOrAfter " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionConditionsNotOnOrAfter';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notOnOrAfter';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-on-or-after';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
//assert (AssertionValue==XacmlValue);
assert (XacmlValue == '2009-05-07T02:00:17.000Z')
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#date';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionContentReference " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionContentReference';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentReference';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-reference';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionContentType " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionContentType';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentType';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-type';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionContent " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionContent';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:content';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="HomeCommunityId" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='home-community-id';
def AssertionXpath='//ec:assertion/nc:homeCommunity/nc:homeCommunityId';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:home-community-id';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="OrganizationId" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='organizationid';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:org/nc:homeCommunityId';
def XacmlAttributeId='urn:oasis:names:tc:xspa:1.0:subject:organization-id';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#anyURI';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PatientId" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='PatientId';
def AssertionXpath='//ec:assertion/nc:uniquePatientId';
def XacmlAttributeId='http://www.hhs.gov/healthit/nhin#subject-id';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
mockRequestHolder.namespaces['hl7'] = 'urn:hl7-org:v3';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValueExtension = mockRequestHolder["//xacml:Resource/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue/hl7:PatientId/@extension"]
def ExpectedExtension = '1.1';
log.info('XacmlAttributeValue(' + FieldName + '@extension)=' + XacmlValueExtension);
//log.info('XacmlAttributeValue(' + FieldName + '@extension) == ' + 'AssertionValue(' + FieldName + '@extension) => ' + (AssertionValue==XacmlValueExtension));
assert(XacmlValueExtension==ExpectedExtension);
def XacmlValueRoot = mockRequestHolder["//xacml:Resource/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue/hl7:PatientId/@root"]
def ExpectedRoot = '500000000';
log.info('XacmlAttributeValue(' + FieldName + '@root)=' + XacmlValueRoot);
//log.info('XacmlAttributeValue(' + FieldName + '@extension) == ' + 'AssertionValue(' + FieldName + '@extension) => ' + (AssertionValue==XacmlValueExtension));
assert(XacmlValueRoot==ExpectedRoot);
def ActualDataType = mockRequestHolder["//xacml:Resource/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'urn:hl7-org:v3#II';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionAccessConsent" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionAccessConsent';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:accessConsentPolicy';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-access-consent';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#anyURI';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionInstanceAccessConsent" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionInstanceAccessConsent';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:instanceAccessConsentPolicy';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-instance-access-consent';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#anyURI';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion type="XPath Match">
<con:configuration/>
</con:assertion>
<con:assertion disabled="true" name="Namespace for Action" type="XPath Match">
<con:configuration>
<path>declare namespace ns6='urn:oasis:names:tc:xacml:2.0:context:schema:os';
declare namespace ns19='urn:gov:hhs:fha:nhinc:common:nhinccommonadapter';
//ns19:CheckPolicyRequest[1]/ns19:request[1]/ns6:Resource[1]/ns6:Attribute[6]/@AttributeId</path>
<content>urn:oasis:names:tc:SAML:1.0:action:rwedc:saml-authz-decision-statement-action</content>
<allowWildcards>false</allowWildcards>
<ignoreNamspaceDifferences>false</ignoreNamspaceDifferences>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="Action Value" type="XPath Match">
<con:configuration>
<path>declare namespace ns6='urn:oasis:names:tc:xacml:2.0:context:schema:os';
declare namespace ns19='urn:gov:hhs:fha:nhinc:common:nhinccommonadapter';
//ns19:CheckPolicyRequest[1]/ns19:request[1]/ns6:Resource[1]/ns6:Attribute[6]/ns6:AttributeValue[1]</path>
<content>Execute</content>
<allowWildcards>false</allowWildcards>
<ignoreNamspaceDifferences>false</ignoreNamspaceDifferences>
</con:configuration>
</con:assertion>
<con:assertion type="XPath Match">
<con:configuration>
<path>declare namespace ns18='urn:gov:hhs:fha:nhinc:common:nhinccommon';
declare namespace ns19='urn:gov:hhs:fha:nhinc:common:nhinccommonadapter';
//ns19:CheckPolicyRequest[1]/ns19:assertion[1]/ns18:samlAuthzDecisionStatement[1]/ns18:action[1]</path>
<content>Execute</content>
<allowWildcards>false</allowWildcards>
<ignoreNamspaceDifferences>false</ignoreNamspaceDifferences>
</con:configuration>
</con:assertion>
</con:config>
</con:testStep>
<con:properties/>
<con:reportParameters/>
<con:tearDownScript>FileUtils.restoreToMasterConfiguration(context, log);</con:tearDownScript>
</con:testCase>
<con:testCase failOnError="true" failTestCaseOnErrors="true" id="fd1b9658-4c4e-40fa-b962-8cb80efc9daa" keepSession="false" maxResults="0" name="inbound doc retrieve" searchProperties="true">
<con:settings/>
<con:testStep name="update config" type="groovy">
<con:settings/>
<con:config><script>nhinc.FileUtils.createOrUpdateConnection("internalConnectionInfo.xml", context.findProperty("GatewayPropDir"),"1.1","policyengineservice","http://localhost:18084/mockPolicyEngine", "LEVEL_a0", log);
</script></con:config>
</con:testStep>
<con:testStep name="send request" type="request">
<con:settings/>
<con:config xsi:type="con:RequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<con:interface>NhincProxyDocRetrieveBindingSoap</con:interface>
<con:operation>RespondingGateway_CrossGatewayRetrieve</con:operation>
<con:request name="send request">
<con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings>
<con:encoding>UTF-8</con:encoding>
<con:endpoint>${#Project#NhincProxyDocRetrieveEndpoint}</con:endpoint>
<con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:gov:hhs:fha:nhinc:common:nhinccommonproxy" xmlns:urn1="urn:ihe:iti:xds-b:2007" xmlns:urn2="urn:gov:hhs:fha:nhinc:common:nhinccommon" xmlns:add="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soapenv:Header/>
<soapenv:Body projectName="PolicyEngineInteractions" testCase="inbound doc retrieve">
<urn:RespondingGateway_CrossGatewayRetrieveRequest>
<urn1:RetrieveDocumentSetRequest>
<urn1:DocumentRequest>
<urn1:HomeCommunityId>urn:oid:2.16.840.1.113883.3.198</urn1:HomeCommunityId>
<urn1:RepositoryUniqueId>1</urn1:RepositoryUniqueId>
<urn1:DocumentUniqueId>555555555</urn1:DocumentUniqueId>
</urn1:DocumentRequest>
</urn1:RetrieveDocumentSetRequest>
<urn:assertion xmlns:urn3="urn:gov:hhs:fha:nhinc:common:nhinccommon">
<urn3:address>
<urn3:addressType>
<urn3:code>W</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:addressType>
<urn3:city>BUFFALO</urn3:city>
<urn3:country>USA</urn3:country>
<urn3:state>NY</urn3:state>
<urn3:streetAddress>12345 EAST COAST WAY</urn3:streetAddress>
<urn3:zipCode>01010</urn3:zipCode>
</urn3:address>
<urn3:dateOfBirth>19800516</urn3:dateOfBirth>
<urn3:explanationNonClaimantSignature>NEEDED</urn3:explanationNonClaimantSignature>
<urn3:haveSecondWitnessSignature>true</urn3:haveSecondWitnessSignature>
<urn3:haveSignature>true</urn3:haveSignature>
<urn3:haveWitnessSignature>true</urn3:haveWitnessSignature>
<urn3:homeCommunity>
<urn3:description>Federal - VA</urn3:description>
<urn3:homeCommunityId>2.16.840.1.113883.3.200</urn3:homeCommunityId>
<urn3:name>Federal - VA</urn3:name>
</urn3:homeCommunity>
<urn3:personName>
<urn3:familyName>JONES</urn3:familyName>
<urn3:givenName>FRED</urn3:givenName>
<urn3:nameType>
<urn3:code>G</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:nameType>
<urn3:secondNameOrInitials>ANDREW</urn3:secondNameOrInitials>
<urn3:fullName/>
</urn3:personName>
<urn3:phoneNumber>
<urn3:areaCode>703</urn3:areaCode>
<urn3:countryCode>1</urn3:countryCode>
<urn3:extension>1212</urn3:extension>
<urn3:localNumber>555</urn3:localNumber>
<urn3:phoneNumberType>
<urn3:code>W</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:phoneNumberType>
</urn3:phoneNumber>
<urn3:secondWitnessAddress>
<urn3:addressType>
<urn3:code>W</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:addressType>
<urn3:city>ALBANY</urn3:city>
<urn3:country>USA</urn3:country>
<urn3:state>NY</urn3:state>
<urn3:streetAddress>4 TROY STREET</urn3:streetAddress>
<urn3:zipCode>01033</urn3:zipCode>
</urn3:secondWitnessAddress>
<urn3:secondWitnessName>
<urn3:familyName>JONES</urn3:familyName>
<urn3:givenName>JAMES</urn3:givenName>
<urn3:nameType>
<urn3:code>G</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:nameType>
<urn3:secondNameOrInitials>KENNETH</urn3:secondNameOrInitials>
<urn3:fullName/>
</urn3:secondWitnessName>
<urn3:secondWitnessPhone>
<urn3:areaCode>301</urn3:areaCode>
<urn3:countryCode>1</urn3:countryCode>
<urn3:extension>555</urn3:extension>
<urn3:localNumber>0001</urn3:localNumber>
<urn3:phoneNumberType>
<urn3:code>W</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:phoneNumberType>
</urn3:secondWitnessPhone>
<urn3:SSN>123456789</urn3:SSN>
<urn3:uniquePatientId xmlns:urn1="urn:gov:hhs:fha:nhinc:common:nhinccommon">500000000^^^&1.1&ISO</urn3:uniquePatientId>
<urn3:witnessAddress>
<urn3:addressType>
<urn3:code>H</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:addressType>
<urn3:city>HARTFORD</urn3:city>
<urn3:country>USA</urn3:country>
<urn3:state>CT</urn3:state>
<urn3:streetAddress>10410 MAIN ST.</urn3:streetAddress>
<urn3:zipCode>05032</urn3:zipCode>
</urn3:witnessAddress>
<urn3:witnessName>
<urn3:familyName>COREY</urn3:familyName>
<urn3:givenName>AMANDA</urn3:givenName>
<urn3:nameType>
<urn3:code>H</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:nameType>
<urn3:secondNameOrInitials>EVE</urn3:secondNameOrInitials>
<urn3:fullName/>
</urn3:witnessName>
<urn3:witnessPhone>
<urn3:areaCode>202</urn3:areaCode>
<urn3:countryCode>1</urn3:countryCode>
<urn3:extension>555</urn3:extension>
<urn3:localNumber>1010</urn3:localNumber>
<urn3:phoneNumberType>
<urn3:code>H</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:phoneNumberType>
</urn3:witnessPhone>
<urn3:userInfo>
<urn3:personName>
<urn3:familyName>FRANKLIN</urn3:familyName>
<urn3:givenName>MARK</urn3:givenName>
<urn3:nameType>
<urn3:code>P</urn3:code>
<urn3:codeSystem/>
<urn3:codeSystemName/>
<urn3:codeSystemVersion/>
<urn3:displayName/>
<urn3:originalText/>
</urn3:nameType>
<urn3:secondNameOrInitials>ALAN</urn3:secondNameOrInitials>
<urn3:fullName/>
</urn3:personName>
<urn3:userName>mfranklin</urn3:userName>
<urn3:org>
<urn3:description>Federal - VA</urn3:description>
<urn3:homeCommunityId>2.16.840.1.113883.3.200</urn3:homeCommunityId>
<urn3:name>Federal - VA</urn3:name>
</urn3:org>
<urn3:roleCoded>
<urn3:code>80584001</urn3:code>
<urn3:codeSystem>2.16.840.1.113883.6.96</urn3:codeSystem>
<urn3:codeSystemName>SNOMED_CT</urn3:codeSystemName>
<urn3:codeSystemVersion>1.0</urn3:codeSystemVersion>
<urn3:displayName>Psychiatrist</urn3:displayName>
<urn3:originalText>Psychiatrist</urn3:originalText>
</urn3:roleCoded>
</urn3:userInfo>
<urn3:authorized>true</urn3:authorized>
<urn3:purposeOfDisclosureCoded>
<urn3:code>PSYCHOTHERAPY</urn3:code>
<urn3:codeSystem>2.16.840.1.113883.3.18.7.1</urn3:codeSystem>
<urn3:codeSystemName>nhin-purpose</urn3:codeSystemName>
<urn3:codeSystemVersion>1.0</urn3:codeSystemVersion>
<urn3:displayName>Use or disclosure of Psychotherapy Notes</urn3:displayName>
<urn3:originalText>Psychotherapy Notes</urn3:originalText>
</urn3:purposeOfDisclosureCoded>
<!--urn3:claimFormRef>Ref-Clm-123</urn3:claimFormRef-->
<!--urn3:claimFormRaw>YWVvbGlhbQ==</urn3:claimFormRaw-->
<urn3:samlAuthnStatement>
<urn3:authInstant>2009-09-01T13:00:00.000Z</urn3:authInstant>
<urn3:sessionIndex>mySessionIndex</urn3:sessionIndex>
<urn3:authContextClassRef>myContextClassRef</urn3:authContextClassRef>
<urn3:subjectLocalityAddress>mySubjectLocalityAddress</urn3:subjectLocalityAddress>
<urn3:subjectLocalityDNSName>mySubjectLocalityDns</urn3:subjectLocalityDNSName>
</urn3:samlAuthnStatement>
<urn3:samlAuthzDecisionStatement>
<urn3:decision>Permit</urn3:decision>
<urn3:resource>myAuthzDecisionStatementResource</urn3:resource>
<urn3:action>myAuthzDecisionStatementAction</urn3:action>
<urn3:evidence>
<urn3:assertion>
<urn3:id>AuthzDecisionStatementEvidenceAssertionId</urn3:id>
<urn3:issueInstant>2009-09-02T14:00:00.000Z</urn3:issueInstant>
<urn3:version>2.0</urn3:version>
<urn3:issuer>CN=Mr Saml User,OU=SU,O=Mr SAML Org,L=Chantilly,ST=VA,C=US</urn3:issuer>
<urn3:issuerFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</urn3:issuerFormat>
<urn3:conditions>
<urn3:notBefore>2001-01-01T01:00:00.000Z</urn3:notBefore>
<urn3:notOnOrAfter>2005-05-06T22:00:17.000Z</urn3:notOnOrAfter>
</urn3:conditions>
<urn3:accessConsentPolicy>urn:oid:1.2.3.4</urn3:accessConsentPolicy>
<urn3:instanceAccessConsentPolicy>urn:oid:1.2.3.4.123456789</urn3:instanceAccessConsentPolicy>
</urn3:assertion>
</urn3:evidence>
</urn3:samlAuthzDecisionStatement>
</urn:assertion>
<urn:nhinTargetSystem>
<urn2:homeCommunity>
<urn2:description>localmachine</urn2:description>
<urn2:homeCommunityId>1.1</urn2:homeCommunityId>
<urn2:name>localmachine</urn2:name>
</urn2:homeCommunity>
</urn:nhinTargetSystem>
</urn:RespondingGateway_CrossGatewayRetrieveRequest>
</soapenv:Body>
</soapenv:Envelope>]]></con:request>
<con:assertion type="SOAP Response"/>
<con:assertion type="SOAP Fault Assertion"/>
<con:assertion disabled="true" name="UserRoleCodeSystem " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking user role system');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystem)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystem"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="UserRoleCodeSystemName " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking user role system name');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystemName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system-name'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystemName"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system-name']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system-name']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="UserRoleCodeDiplayName " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('Checking user role display name');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:userInfo/nc:roleCoded/nc:displayName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-description'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:userInfo/nc:roleCoded/nc:displayName"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-description']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:user-role-description']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="PurposeForUseCode" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('PurposeForUseCode');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:purposeOfDisclosureCoded/nc:code)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:purposeOfDisclosureCoded/nc:code"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="PurposeForUseCodeSystem" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('PurposeForUseCodeSystem');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystem)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystem"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="PurposeForUseCodeSystemName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('PurposeForUseCodeSystemName');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystemName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system-name'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystemName"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system-name']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system-name']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="PurposeForUseCodeDisplayName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('PurposeForUseCodeDisplayName');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:purposeOfDisclosureCoded/nc:displayName)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-display-name'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:purposeOfDisclosureCoded/nc:displayName"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-display-name']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Subject/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-display-name']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementDecision" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementDecision');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:decision)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-decision'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:decision"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-decision']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-decision']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementResource" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementResource');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:resource)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:resource"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementAction" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementAction');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:action)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-action'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:action"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-action']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-action']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionID " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionID');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:id)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-id'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:id"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-id']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-id']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionIssueInstant" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionIssueInstant');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issueInstant)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issue-instant'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issueInstant"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issue-instant']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issue-instant']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionVersion" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionVersion');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:version)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-version'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:version"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-version']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-version']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionIssuer" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionIssuer');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issuer)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issuer'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issuer"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issuer']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issuer']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionConditionsNotBefore" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionConditionsNotBefore');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notBefore)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-before'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notBefore"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-before']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-before']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#date';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionConditionsNotOnOrAfter " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionConditionsNotOnOrAfter');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notOnOrAfter)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-on-or-after'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notOnOrAfter"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-on-or-after']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-on-or-after']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#date';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionContentReference " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionContentReference');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentReference)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-reference'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentReference"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-reference']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-reference']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionContentType " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionContentType');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentType)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-type'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentType"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-type']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-type']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionContent " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info('AuthzDecisionStatementEvidenceAssertionContent');
def requestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
requestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:eventcommon';
requestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def responseHolder = groovyUtils.getXmlHolder( messageExchange.responseContent );
responseHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def AssertionCount = requestHolder["count(//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:content)"];
log.info('AssertionCount=' + AssertionCount);
assert(AssertionCount=="1");
def XacmlAttributeCount = responseHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-asssertion-content'])"];
log.info('Xacml Attribute Count='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def AssertionValue = requestHolder["//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:content"];
log.info('AssertionValue=' + AssertionValue);
def XacmlValue = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-asssertion-content']/xacml:AttributeValue"];
log.info('XacmlValue=' + XacmlValue);
assert (AssertionValue==XacmlValue);
def ActualDataType = responseHolder["//xacml:Resource/xacml:Attribute[@AttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-asssertion-content']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#base64Binary';
assert(ActualDataType==ExpectedDataType);</scriptText>
</con:configuration>
</con:assertion>
<con:credentials><con:authType>Global HTTP Settings</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508"/>
<con:wsrmConfig version="1.2"/>
</con:request>
</con:config>
</con:testStep>
<con:testStep name="mock policy engine" type="mockresponse">
<con:settings/>
<con:config startStep="send request" xsi:type="con:MockResponseStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<con:interface>AdapterPolicyEngineBindingSoap</con:interface>
<con:operation>CheckPolicy</con:operation>
<con:path>/mockPolicyEngine</con:path>
<con:port>18084</con:port>
<con:timeout>30000</con:timeout>
<con:response>
<con:settings/>
<con:responseContent><![CDATA[<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:gov:hhs:fha:nhinc:common:nhinccommonadapter" xmlns:urn1="urn:oasis:names:tc:xacml:2.0:context:schema:os">
<soapenv:Header/>
<soapenv:Body>
<urn:CheckPolicyResponse>
<urn:response>
<urn1:Result>
<urn1:Decision>deny</urn1:Decision>
</urn1:Result>
</urn:response>
</urn:CheckPolicyResponse>
</soapenv:Body>
</soapenv:Envelope>]]></con:responseContent>
<con:wsaConfig mustUnderstand="NONE" version="200508"/>
</con:response>
<con:assertion name="AuthnStatementAuthnInstant " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='authInstant';
def AssertionXpath='//ec:assertion/nc:samlAuthnStatement/nc:authInstant'
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:auth-instant';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthnStatementSessionIndex" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='sessionIndex';
def AssertionXpath='//ec:assertion/nc:samlAuthnStatement/nc:sessionIndex';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:session-index';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthnStatementAthnContextClassRef " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='authContextClassRef';
def AssertionXpath='//ec:assertion/nc:samlAuthnStatement/nc:authContextClassRef';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authn-statement:auth-context-class-ref';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthnStatementSubjectLocalityAddress " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='subjectLocalityAddress';
def AssertionXpath='//ec:assertion/nc:samlAuthnStatement/nc:subjectLocalityAddress';
def XacmlAttributeId='urn:oasis:names:tc:xacml:1.0:subject:authn-locality:ip-address';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthnStatementDNSName " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='subjectLocalityDNSName';
def AssertionXpath='//ec:assertion/nc:samlAuthnStatement/nc:subjectLocalityDNSName';
def XacmlAttributeId='urn:oasis:names:tc:xacml:1.0:subject:authn-locality:dns-name';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserPersonName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='personname';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:userName';
def XacmlAttributeId='urn:oasis:names:tc:xacml:1.0:subject:subject-id';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserOrganizationName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='user organization';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:org/nc:name';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:user-organization-name';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserRoleCode" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='user role coded';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:roleCoded/nc:code';
//def XacmlAttributeId='urn:gov:hhs:fha:nhinc:user-role-code';
def XacmlAttributeId='urn:oasis:names:tc:xacml:2.0:subject:role';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserRoleCodeSystem " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='user role system';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystem';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserRoleCodeSystemName " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='user role system name';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:roleCoded/nc:codeSystemName';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:user-role-code-system-name';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="UserRoleCodeDiplayName " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='user role display name';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:roleCoded/nc:displayName';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:user-role-description';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PurposeForUseCode" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='PurposeForUseCode';
def AssertionXpath='//ec:assertion/nc:purposeOfDisclosureCoded/nc:code';
//def XacmlAttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code';
def XacmlAttributeId='urn:oasis:names:tc:xspa:1.0:subject:purposeofuse';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PurposeForUseCodeSystem" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='PurposeForUseCodeSystem';
def AssertionXpath='//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystem';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PurposeForUseCodeSystemName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='PurposeForUseCodeSystemName';
def AssertionXpath='//ec:assertion/nc:purposeOfDisclosureCoded/nc:codeSystemName';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-code-system-name';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PurposeForUseCodeDisplayName" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='PurposeForUseCodeDisplayName';
def AssertionXpath='//ec:assertion/nc:purposeOfDisclosureCoded/nc:displayName';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:purpose-of-use-display-name';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementDecision" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementDecision';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:decision';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-decision';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementResource" type="GroovyScriptAssertion">
<con:configuration><scriptText>def FieldName='AuthzDecisionStatementResource';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:resource';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
//def AssertionValue = sourceRequestHolder[AssertionXpath];
//log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
def AssertionValue='https://localhost:8181/Gateway/DocumentRetrieve/3_0/NhinService/RespondingGateway_Retrieve_Service/DocRetrieve';
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText></con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementAction" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementAction';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:action';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-action';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
//log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
def ExpectedValue='Execute';
//log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (ExpectedValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionID " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionID';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:id';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-id';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionIssueInstant" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionIssueInstant';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issueInstant';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issue-instant';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionVersion" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionVersion';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:version';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-version';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionIssuer" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionIssuer';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:issuer';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-issuer';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionConditionsNotBefore" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionConditionsNotBefore';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notBefore';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-before';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
//assert (AssertionValue==XacmlValue);
assert (XacmlValue == '2001-01-01T06:00:00.000Z')
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#date';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionConditionsNotOnOrAfter " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionConditionsNotOnOrAfter';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:conditions/nc:notOnOrAfter';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-not-on-or-after';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
//assert (AssertionValue==XacmlValue);
assert (XacmlValue == '2009-05-07T02:00:17.000Z')
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#date';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionContentReference " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionContentReference';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentReference';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-reference';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionContentType " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionContentType';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:contentType';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content-type';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="AuthzDecisionStatementEvidenceAssertionContent " type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionContent';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:content';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-content';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="HomeCommunityId" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='home-community-id';
def AssertionXpath='//ec:assertion/nc:homeCommunity/nc:homeCommunityId';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:home-community-id';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#string';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="OrganizationId" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='organizationid';
def AssertionXpath='//ec:assertion/nc:userInfo/nc:org/nc:homeCommunityId';
def XacmlAttributeId='urn:oasis:names:tc:xspa:1.0:subject:organization-id';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:Subject/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#anyURI';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="PatientId" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='PatientId';
def AssertionXpath='//ec:assertion/nc:uniquePatientId';
def XacmlAttributeId='http://www.hhs.gov/healthit/nhin#subject-id';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
mockRequestHolder.namespaces['hl7'] = 'urn:hl7-org:v3';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:Resource/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValueExtension = mockRequestHolder["//xacml:Resource/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue/hl7:PatientId/@extension"]
def ExpectedExtension='500000000';
log.info('XacmlAttributeValue(' + FieldName + '@extension)=' + XacmlValueExtension);
//log.info('XacmlAttributeValue(' + FieldName + '@extension) == ' + 'AssertionValue(' + FieldName + '@extension) => ' + (AssertionValue==XacmlValueExtension));
assert (ExpectedExtension==XacmlValueExtension);
def XacmlValueRoot = mockRequestHolder["//xacml:Resource/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue/hl7:PatientId/@root"]
def ExpectedRoot='1.1';
log.info('XacmlAttributeValue(' + FieldName + '@root)=' + XacmlValueRoot);
//log.info('XacmlAttributeValue(' + FieldName + '@extension) == ' + 'AssertionValue(' + FieldName + '@extension) => ' + (AssertionValue==XacmlValueExtension));
assert (ExpectedRoot==XacmlValueRoot);
def ActualDataType = mockRequestHolder["//xacml:Resource/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'urn:hl7-org:v3#II';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionAccessConsent" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionAccessConsent';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:accessConsentPolicy';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-access-consent';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#anyURI';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion name="AuthzDecisionStatementEvidenceAssertionInstanceAccessConsent" type="GroovyScriptAssertion">
<con:configuration>
<scriptText>def FieldName='AuthzDecisionStatementEvidenceAssertionInstanceAccessConsent';
def AssertionXpath='//ec:assertion/nc:samlAuthzDecisionStatement/nc:evidence/nc:assertion/nc:instanceAccessConsentPolicy';
def XacmlAttributeId='urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-evidence-assertion-instance-access-consent';
def XacmlAttributeParent='Resource';
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.debug('Checking ' + FieldName);
log.debug("access initial request message");
def requestTestStep = context.getTestRunner().testCase.getTestStepByName("send request");
def sourceRequestHolder = groovyUtils.getXmlHolder(requestTestStep.getProperty("Request").value);
sourceRequestHolder.namespaces['ec'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommonproxy';
sourceRequestHolder.namespaces['nc'] = 'urn:gov:hhs:fha:nhinc:common:nhinccommon';
def AssertionCount = sourceRequestHolder["count(" + AssertionXpath + ")"];
log.info('AssertionCount(' + FieldName + ')=' + AssertionCount);
assert(AssertionCount=="1");
def AssertionValue = sourceRequestHolder[AssertionXpath];
log.info('AssertionValue(' + FieldName + ')=' + AssertionValue);
def mockRequestHolder = groovyUtils.getXmlHolder( messageExchange.requestContent );
mockRequestHolder.namespaces['xacml'] = 'urn:oasis:names:tc:xacml:2.0:context:schema:os';
def XacmlAttributeCount = mockRequestHolder["count(//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "'])"];
log.info('XacmlAttributeCount(' + FieldName + ')='+XacmlAttributeCount);
assert(XacmlAttributeCount=="1");
def XacmlValue = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/xacml:AttributeValue"];
log.info('XacmlAttributeValue(' + FieldName + ')=' + XacmlValue);
log.info('XacmlAttributeValue(' + FieldName + ') == ' + 'AssertionValue(' + FieldName + ') => ' + (AssertionValue==XacmlValue));
assert (AssertionValue==XacmlValue);
def ActualDataType = mockRequestHolder["//xacml:" + XacmlAttributeParent + "/xacml:Attribute[@AttributeId='" + XacmlAttributeId + "']/@DataType"];
def ExpectedDataType = 'http://www.w3.org/2001/XMLSchema#anyURI';
assert(ActualDataType==ExpectedDataType);
log.debug('Finished checking ' + FieldName);
</scriptText>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" name="Namespace for Action" type="XPath Match">
<con:configuration>
<path>declare namespace ns6='urn:oasis:names:tc:xacml:2.0:context:schema:os';
declare namespace ns19='urn:gov:hhs:fha:nhinc:common:nhinccommonadapter';
//ns19:CheckPolicyRequest[1]/ns19:request[1]/ns6:Resource[1]/ns6:Attribute[7]/@AttributeId</path>
<content>urn:oasis:names:tc:SAML:1.0:action:rwedc:saml-authz-decision-statement-action</content>
<allowWildcards>false</allowWildcards>
<ignoreNamspaceDifferences>false</ignoreNamspaceDifferences>
</con:configuration>
</con:assertion>
<con:assertion disabled="true" type="XPath Match">
<con:configuration>
<path>declare namespace ns6='urn:oasis:names:tc:xacml:2.0:context:schema:os';
declare namespace ns19='urn:gov:hhs:fha:nhinc:common:nhinccommonadapter';
//ns19:CheckPolicyRequest[1]/ns19:request[1]/ns6:Resource[1]/ns6:Attribute[7]/ns6:AttributeValue[1]</path>
<content>Execute</content>
<allowWildcards>false</allowWildcards>
<ignoreNamspaceDifferences>false</ignoreNamspaceDifferences>
</con:configuration>
</con:assertion>
<con:assertion type="XPath Match">
<con:configuration>
<path>declare namespace ns18='urn:gov:hhs:fha:nhinc:common:nhinccommon';
declare namespace ns19='urn:gov:hhs:fha:nhinc:common:nhinccommonadapter';
//ns19:CheckPolicyRequest[1]/ns19:assertion[1]/ns18:samlAuthzDecisionStatement[1]/ns18:action[1]</path>
<content>Execute</content>
<allowWildcards>false</allowWildcards>
<ignoreNamspaceDifferences>false</ignoreNamspaceDifferences>
</con:configuration>
</con:assertion>
</con:config>
</con:testStep>
<con:setupScript>nhinc.FileUtils.backupConfiguration(context.findProperty("GatewayPropDir"), log);</con:setupScript><con:properties/>
<con:reportParameters/>
<con:tearDownScript>nhinc.FileUtils.restoreConfiguration(context.findProperty("GatewayPropDir"), log);</con:tearDownScript>
</con:testCase>
<con:properties/>
<con:reportParameters/>
</con:testSuite>
<con:requirements/>
<con:properties>
<con:property>
<con:name>NhincProxyDocRetrieveEndpoint</con:name>
<con:value>http://localhost:8080/Gateway/DocumentRetrieve/2_0/NhincProxyDocRetrieveUnsecured</con:value>
</con:property>
<con:property>
<con:name>NhincProxyDocQueryEndpoint</con:name>
<con:value>http://localhost:8080/Gateway/DocumentQuery/2_0/EntityService/NhincProxyDocQueryUnsecured</con:value>
</con:property>
<con:property>
<con:name>GlassfishConfigurationDirectory</con:name>
<con:value>C:/Sun/AppServer/domains/domain1/config</con:value>
</con:property>
<con:property>
<con:name>GatewayConfigurationDirectory</con:name>
<con:value>C:/Sun/AppServer/domains/domain1/config/nhin</con:value>
</con:property>
<con:property>
<con:name>Mockhost</con:name>
<con:value>localhost</con:value>
</con:property>
<con:property><con:name>GatewayPropDir</con:name><con:value>c:\glassfish3\glassfish\domains\domain1\config\nhin</con:value></con:property></con:properties>
<con:afterLoadScript>def propertiesFile = new File(new File(project.path).parent, 'PolicyEngineInteractions-soapui-project.properties')
if (propertiesFile.exists()) {
def props = new Properties()
props.load(new FileReader(propertiesFile))
props.each { key, value ->
project.setPropertyValue(key, value)
}
}
com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext.metaClass.findProperty = { propertyName ->
return delegate.getProperty(propertyName) ?:
delegate.testCase.getPropertyValue(propertyName) ?:
delegate.testCase.testSuite.getPropertyValue(propertyName) ?:
delegate.testCase.testSuite.project.getPropertyValue(propertyName)
}</con:afterLoadScript>
<con:wssContainer/>
<con:databaseConnectionContainer/>
<con:reporting>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:xmlTemplates/>
<con:parameters/>
</con:reporting>
</con:soapui-project> | {
"content_hash": "fd946bda84ce52923a6f4274e85c8839",
"timestamp": "",
"source": "github",
"line_count": 6334,
"max_line_length": 481,
"avg_line_length": 53.54215345753079,
"alnum_prop": 0.7398388846952255,
"repo_name": "AurionProject/Aurion",
"id": "83ed98462103062cd2666988804ed7a7eca15516",
"size": "339136",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Product/SoapUI_Test/GraveyardSuite/PolicyEngineInteractions-soapui-project.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "2465"
},
{
"name": "CSS",
"bytes": "62138"
},
{
"name": "Groovy",
"bytes": "1641"
},
{
"name": "HTML",
"bytes": "170838"
},
{
"name": "Java",
"bytes": "15665942"
},
{
"name": "JavaScript",
"bytes": "6991"
},
{
"name": "PLSQL",
"bytes": "110879"
},
{
"name": "Python",
"bytes": "773"
},
{
"name": "SQLPL",
"bytes": "1363363"
},
{
"name": "Shell",
"bytes": "30106"
},
{
"name": "XSLT",
"bytes": "35057"
}
],
"symlink_target": ""
} |
<?php
use kartik\helpers\Html;
//use yii\widgets\ActiveForm;
use kartik\widgets\ActiveForm;
use kartik\builder\Form;
use kartik\builder\FormGrid;
use yii\grid\GridView;
use yii\bootstrap\Modal;
use yii\helpers\Url;
use yii\widgets\Pjax;
use kartik\datecontrol\DateControl;
use yii\helpers\ArrayHelper;
use app\models\PerancanganProgram;
// contant values
use app\models\general\Placeholder;
use app\models\general\GeneralLabel;
use app\models\general\GeneralVariable;
use app\models\general\GeneralMessage;
/* @var $this yii\web\View */
/* @var $model app\models\PengurusanMediaProgram */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="pengurusan-media-program-form">
<p class="text-muted"><span style="color: red">*</span> <?= GeneralLabel::mandatoryField?></p>
<?php
if(!$readonly){
$template = '{view} {update} {delete}';
} else {
$template = '{view}';
}
?>
<?php $form = ActiveForm::begin(['type'=>ActiveForm::TYPE_VERTICAL, 'staticOnly'=>$readonly]); ?>
<?php
echo FormGrid::widget([
'model' => $model,
'form' => $form,
'autoGenerateColumns' => true,
'rows' => [
[
'columns'=>12,
'autoGenerateColumns'=>false, // override columns setting
'attributes' => [
'tarikh_mula' => [
'type'=>Form::INPUT_WIDGET,
'widgetClass'=> DateControl::classname(),
'ajaxConversion'=>false,
'options'=>[
'type'=>DateControl::FORMAT_DATETIME,
'pluginOptions' => [
'autoclose'=>true,
]
],
'columnOptions'=>['colspan'=>3]],
'tarikh_tamat' => [
'type'=>Form::INPUT_WIDGET,
'widgetClass'=> DateControl::classname(),
'ajaxConversion'=>false,
'options'=>[
'type'=>DateControl::FORMAT_DATETIME,
'pluginOptions' => [
'autoclose'=>true,
]
],
'columnOptions'=>['colspan'=>3]],
'nama_program' => ['type'=>Form::INPUT_TEXT,'columnOptions'=>['colspan'=>6],'options'=>['maxlength'=>80]],
],
],
[
'columns'=>12,
'autoGenerateColumns'=>false, // override columns setting
'attributes' => [
'tempat' => ['type'=>Form::INPUT_TEXT,'columnOptions'=>['colspan'=>6],'options'=>['maxlength'=>90]],
'cawangan' => ['type'=>Form::INPUT_TEXT,'columnOptions'=>['colspan'=>6],'options'=>['maxlength'=>80]],
],
],
[
'columns'=>12,
'autoGenerateColumns'=>false, // override columns setting
'attributes' => [
'pengerusi_program' => ['type'=>Form::INPUT_TEXT,'columnOptions'=>['colspan'=>6],'options'=>['maxlength'=>80]],
],
],
[
'columns'=>12,
'autoGenerateColumns'=>false, // override columns setting
'attributes' => [
//'maklumat_msn_negeri' => ['type'=>Form::INPUT_TEXT,'columnOptions'=>['colspan'=>4],'options'=>['maxlength'=>5]],
'catatan' => ['type'=>Form::INPUT_TEXTAREA,'columnOptions'=>['colspan'=>8],'options'=>['maxlength'=>255]],
],
],
]
]);
?>
<h3><?php echo GeneralLabel::kehadiran_wartawan; ?></h3>
<?php
Modal::begin([
'header' => '<h3 id="modalTitle"></h3>',
'id' => 'modal',
'size' => 'modal-lg',
'clientOptions' => ['backdrop' => 'static', 'keyboard' => FALSE],
'options' => [
'tabindex' => false // important for Select2 to work properly
],
]);
echo '<div id="modalContent"></div>';
Modal::end();
?>
<?php Pjax::begin(['id' => 'kehadiranMediaProgramGrid', 'timeout' => 100000]); ?>
<?= GridView::widget([
'dataProvider' => $dataProviderKehadiranMediaProgram,
//'filterModel' => $searchModelKehadiranMediaProgram,
'id' => 'kehadiranMediaProgramGrid',
'columns' => [
['class' => 'yii\grid\SerialColumn'],
//'pengurusan_kehadiran_media_program_id',
//'pengurusan_media_program_id',
//'nama_wartawan',
[
'attribute' => 'nama_wartawan',
'value' => 'refProfilWartawanSukan.nama'
],
//['class' => 'yii\grid\ActionColumn'],
['class' => 'yii\grid\ActionColumn',
'buttons' => [
'delete' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-trash"></span>', 'javascript:void(0);', [
'title' => Yii::t('yii', 'Delete'),
'onclick' => 'deleteRecordModalAjax("'.Url::to(['pengurusan-kehadiran-media-program/delete', 'id' => $model->pengurusan_kehadiran_media_program_id]).'", "'.GeneralMessage::confirmDelete.'", "kehadiranMediaProgramGrid");',
//'data-confirm' => 'Czy na pewno usunąć ten rekord?',
]);
},
'update' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', 'javascript:void(0);', [
'title' => Yii::t('yii', 'Update'),
'onclick' => 'loadModalRenderAjax("'.Url::to(['pengurusan-kehadiran-media-program/update', 'id' => $model->pengurusan_kehadiran_media_program_id]).'", "'.GeneralLabel::updateTitle . ' '.GeneralLabel::kehadiran_wartawan.'");',
]);
},
'view' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', 'javascript:void(0);', [
'title' => Yii::t('yii', 'View'),
'onclick' => 'loadModalRenderAjax("'.Url::to(['pengurusan-kehadiran-media-program/view', 'id' => $model->pengurusan_kehadiran_media_program_id]).'", "'.GeneralLabel::viewTitle . ' '.GeneralLabel::kehadiran_wartawan.'");',
]);
}
],
'template' => $template,
],
],
]); ?>
<?php Pjax::end(); ?>
<?php if(!$readonly): ?>
<p>
<?php
$pengurusan_media_program_id = "";
if(isset($model->pengurusan_media_program_id)){
$pengurusan_media_program_id = $model->pengurusan_media_program_id;
}
echo Html::a('<span class="glyphicon glyphicon-plus"></span>', 'javascript:void(0);', [
'onclick' => 'loadModalRenderAjax("'.Url::to(['pengurusan-kehadiran-media-program/create', 'pengurusan_media_program_id' => $pengurusan_media_program_id]).'", "'.GeneralLabel::createTitle . ' '.GeneralLabel::kehadiran_wartawan.'");',
'class' => 'btn btn-success',
]);?>
</p>
<?php endif; ?>
<br>
<h3><?php echo GeneralLabel::kehadiran_wakil; ?></h3>
<?php
Modal::begin([
'header' => '<h3 id="modalTitle"></h3>',
'id' => 'modal',
'size' => 'modal-lg',
'clientOptions' => ['backdrop' => 'static', 'keyboard' => FALSE]
]);
echo '<div id="modalContent"></div>';
Modal::end();
?>
<?php Pjax::begin(['id' => 'pengurusanMediaProgramWakilGrid', 'timeout' => 100000]); ?>
<?= GridView::widget([
'dataProvider' => $dataProviderPengurusanMediaProgramWakil,
//'filterModel' => $searchModelPengurusanMediaProgramWakil,
'id' => 'pengurusanMediaProgramWakilGrid',
'columns' => [
['class' => 'yii\grid\SerialColumn'],
//'pengurusan_media_program_wakil_id',
//'pengurusan_media_program_id',
'nama_wakil',
//'kehadiran',
[
'attribute' => 'kehadiran',
'value' => 'refKehadiranMedia.desc'
],
//'session_id',
// 'created_by',
// 'updated_by',
// 'created',
// 'updated',
//['class' => 'yii\grid\ActionColumn'],
['class' => 'yii\grid\ActionColumn',
'buttons' => [
'delete' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-trash"></span>', 'javascript:void(0);', [
'title' => Yii::t('yii', 'Delete'),
'onclick' => 'deleteRecordModalAjax("'.Url::to(['pengurusan-media-program-wakil/delete', 'id' => $model->pengurusan_media_program_wakil_id]).'", "'.GeneralMessage::confirmDelete.'", "pengurusanMediaProgramWakilGrid");',
//'data-confirm' => 'Czy na pewno usunąć ten rekord?',
]);
},
'update' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', 'javascript:void(0);', [
'title' => Yii::t('yii', 'Update'),
'onclick' => 'loadModalRenderAjax("'.Url::to(['pengurusan-media-program-wakil/update', 'id' => $model->pengurusan_media_program_wakil_id]).'", "'.GeneralLabel::updateTitle . ' '.GeneralLabel::kehadiran_wakil.'");',
]);
},
'view' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', 'javascript:void(0);', [
'title' => Yii::t('yii', 'View'),
'onclick' => 'loadModalRenderAjax("'.Url::to(['pengurusan-media-program-wakil/view', 'id' => $model->pengurusan_media_program_wakil_id]).'", "'.GeneralLabel::viewTitle . ' '.GeneralLabel::kehadiran_wakil.'");',
]);
}
],
'template' => $template,
],
],
]); ?>
<?php Pjax::end(); ?>
<?php if(!$readonly): ?>
<p>
<?php
echo Html::a('<span class="glyphicon glyphicon-plus"></span>', 'javascript:void(0);', [
'onclick' => 'loadModalRenderAjax("'.Url::to(['pengurusan-media-program-wakil/create', 'pengurusan_media_program_id' => $pengurusan_media_program_id]).'", "'.GeneralLabel::createTitle . ' '.GeneralLabel::kehadiran_wakil.'");',
'class' => 'btn btn-success',
]);?>
</p>
<?php endif; ?>
<br>
<h3><?php echo GeneralLabel::dokumen_media_program; ?></h3>
<?php
Modal::begin([
'header' => '<h3 id="modalTitle"></h3>',
'id' => 'modal',
'size' => 'modal-lg',
'clientOptions' => ['backdrop' => 'static', 'keyboard' => FALSE]
]);
echo '<div id="modalContent"></div>';
Modal::end();
?>
<?php Pjax::begin(['id' => 'dokumenMediaProgramGrid', 'timeout' => 100000]); ?>
<?= GridView::widget([
'dataProvider' => $dataProviderDokumenMediaProgram,
//'filterModel' => $searchModelDokumenMediaProgram,
'id' => 'dokumenMediaProgramGrid',
'columns' => [
['class' => 'yii\grid\SerialColumn'],
//'pengurusan_dokumen_media_program_id',
//'pengurusan_media_program_id',
//'kategori_dokumen',
[
'attribute' => 'kategori_dokumen',
'value' => 'refKategoriDokumen.desc'
],
'nama_dokumen',
//'muatnaik',
[
'attribute' => 'muatnaik',
'format' => 'raw',
'value'=>function ($model) {
if($model->muatnaik){
return Html::a(GeneralLabel::viewAttachment, 'javascript:void(0);',
[
'onclick' => 'viewUpload("'.\Yii::$app->request->BaseUrl.'/' . $model->muatnaik .'");'
]);
} else {
return "";
}
},
],
//['class' => 'yii\grid\ActionColumn'],
['class' => 'yii\grid\ActionColumn',
'buttons' => [
'delete' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-trash"></span>', 'javascript:void(0);', [
'title' => Yii::t('yii', 'Delete'),
'onclick' => 'deleteRecordModalAjax("'.Url::to(['pengurusan-dokumen-media-program/delete', 'id' => $model->pengurusan_dokumen_media_program_id]).'", "'.GeneralMessage::confirmDelete.'", "dokumenMediaProgramGrid");',
//'data-confirm' => 'Czy na pewno usunąć ten rekord?',
]);
},
'update' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', 'javascript:void(0);', [
'title' => Yii::t('yii', 'Update'),
'onclick' => 'loadModalRenderAjax("'.Url::to(['pengurusan-dokumen-media-program/update', 'id' => $model->pengurusan_dokumen_media_program_id]).'", "'.GeneralLabel::updateTitle . ' '.GeneralLabel::dokumen_media_program.'");',
]);
},
'view' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', 'javascript:void(0);', [
'title' => Yii::t('yii', 'View'),
'onclick' => 'loadModalRenderAjax("'.Url::to(['pengurusan-dokumen-media-program/view', 'id' => $model->pengurusan_dokumen_media_program_id]).'", "'.GeneralLabel::viewTitle . ' '.GeneralLabel::dokumen_media_program.'");',
]);
}
],
'template' => $template,
],
],
]); ?>
<?php Pjax::end(); ?>
<?php if(!$readonly): ?>
<p>
<?php
echo Html::a('<span class="glyphicon glyphicon-plus"></span>', 'javascript:void(0);', [
'onclick' => 'loadModalRenderAjax("'.Url::to(['pengurusan-dokumen-media-program/create', 'pengurusan_media_program_id' => $pengurusan_media_program_id]).'", "'.GeneralLabel::createTitle . ' '.GeneralLabel::dokumen_media_program.'");',
'class' => 'btn btn-success',
]);?>
</p>
<?php endif; ?>
<br>
<br>
<!--<?= $form->field($model, 'tarikh_mula')->textInput() ?>
<?= $form->field($model, 'nama_program')->textInput(['maxlength' => 80]) ?>
<?= $form->field($model, 'tempat')->textInput(['maxlength' => 90]) ?>
<?= $form->field($model, 'cawangan')->textInput(['maxlength' => 80]) ?>
<?= $form->field($model, 'maklumat_msn_negeri')->textInput(['maxlength' => 80]) ?>
<?= $form->field($model, 'catatan')->textInput(['maxlength' => 255]) ?>-->
<div class="form-group">
<?php if(!$readonly): ?>
<?= Html::submitButton($model->isNewRecord ? GeneralLabel::create : GeneralLabel::update, ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary',
'data' => [
'confirm' => GeneralMessage::confirmSave,
],]) ?>
<?php endif; ?>
</div>
<?php ActiveForm::end(); ?>
</div>
| {
"content_hash": "e805ba9ac7d0e592ed59d785ca6ec088",
"timestamp": "",
"source": "github",
"line_count": 388,
"max_line_length": 258,
"avg_line_length": 42.0180412371134,
"alnum_prop": 0.46690793105563394,
"repo_name": "hung101/kbs",
"id": "4fdbb9d6dc8cf9acb97482076ae3929da6b974eb",
"size": "16309",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frontend/views/pengurusan-media-program/_form.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "113"
},
{
"name": "Batchfile",
"bytes": "1541"
},
{
"name": "CSS",
"bytes": "4999813"
},
{
"name": "HTML",
"bytes": "32884422"
},
{
"name": "JavaScript",
"bytes": "38543640"
},
{
"name": "PHP",
"bytes": "30558998"
},
{
"name": "PowerShell",
"bytes": "936"
},
{
"name": "Shell",
"bytes": "5561"
}
],
"symlink_target": ""
} |
class EstadoSimulacion
def initialize(simulacion)
@simulacion = simulacion
end
def to_s
raise "subclass responsability"
end
def simular
raise "subclass responsability"
end
def siguienteTurnoOFinalizar
raise "subclass responsability"
end
end
class EstadoEnCurso < EstadoSimulacion
def initialize(simulacion, turnosAJugar, turnosTiempoExtra)
super(simulacion)
@turnosAJugar = turnosAJugar
@turnosTiempoExtra = turnosTiempoExtra
equipos = [@simulacion.equipoDesafiante, @simulacion.equipoDesafiado]
## el que saca es uno random
equipoQueSaca = equipos[rand(0..1)]
equipoQueNoSaca = elOtroEquipo(equipoQueSaca)
elPrimerTurno = Turno.new(@simulacion, equipoQueSaca, equipoQueNoSaca)
simulacion.agregarTurno(elPrimerTurno)
end
def to_s
return "Simulación en curso entre: " + @simulacion.equipoDesafiante.to_s() + " y " +
@simulacion.equipoDesafiado.to_s() + ". Puntaje: " +
@simulacion.puntajeDesafiante.to_s() + "-" + @simulacion.puntajeDesafiado.to_s()
end
def elOtroEquipo(equipo)
return @simulacion.elOtroEquipo(equipo)
end
def siguienteTurnoOFinalizar()
# primero verifico si ya termino pero hay empate
if (@simulacion.historialDeTurnos.size() == @turnosAJugar &&
@simulacion.puntajeDesafiado == @simulacion.puntajeDesafiante)
@turnosAJugar += @turnosTiempoExtra
end
if (@simulacion.historialDeTurnos.size() < @turnosAJugar)
equipoAtacante = turnoActual().quienTieneLaProximaPosesion()
equipoDefensor = elOtroEquipo(equipoAtacante)
unNuevoTurno = Turno.new(@simulacion, equipoAtacante, equipoDefensor)
@simulacion.agregarTurno(unNuevoTurno)
simular
else
@simulacion.terminar
end
end
def turnoActual
@simulacion.historialDeTurnos[-1]
end
def simular
turnoActual().simular
end
end
class EstadoTerminado < EstadoSimulacion
def initialize(simulacion)
super(simulacion)
end
def to_s()
start = "Simulación Terminada entre: " + @simulacion.equipoDesafiante.to_s() + " y " +
@simulacion.equipoDesafiado.to_s() + ". Puntaje: " +
@simulacion.puntajeDesafiante.to_s() + "-" + @simulacion.puntajeDesafiado.to_s() +
"\nLog:\n"
return @simulacion.historialDeTurnos.inject(start) { | acum, turno | acum + turno.to_s + "\n" }
end
def simular
raise 'El partido ya está finalizado.'
end
def siguienteTurnoOFinalizar
raise 'El partido ya está finalizado.'
end
end
| {
"content_hash": "360312e1a33f64053d50387b61764720",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 101,
"avg_line_length": 28.155555555555555,
"alnum_prop": 0.7012628255722179,
"repo_name": "chudichudichudi/freddiemercurry",
"id": "9252f6eeb2accd9b2672a9256acdd75dbe941de3",
"size": "2733",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tp_curry/lib/estado.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Makefile",
"bytes": "231"
},
{
"name": "Ruby",
"bytes": "29347"
},
{
"name": "TeX",
"bytes": "26627"
}
],
"symlink_target": ""
} |
package prototypev.PermissiveFov.LevelGeneration.Generators;
import prototypev.PermissiveFov.LevelGeneration.DirectionType;
import prototypev.PermissiveFov.LevelGeneration.Entities.Cell;
import prototypev.PermissiveFov.LevelGeneration.Entities.Room;
import prototypev.PermissiveFov.LevelGeneration.SideType;
import prototypev.PermissiveFov.Randomizer;
import java.util.List;
public class RoomGenerator {
private final int maxHeight;
private final int maxWidth;
private final int minHeight;
private final int minWidth;
/**
* Creates a new RoomGenerator with the specified constraints.
*
* @param minWidth The minimum width of each room to create.
* @param maxWidth The maximum width of each room to create.
* @param minHeight The minimum height of each room to create.
* @param maxHeight The maximum height of each room to create.
*/
public RoomGenerator(int minWidth, int maxWidth, int minHeight, int maxHeight) {
this.minWidth = minWidth;
this.maxWidth = maxWidth;
this.minHeight = minHeight;
this.maxHeight = maxHeight;
}
/**
* @param container The containing room.
* @param room The room to attempt to be placed in the containing room.
* @param x The horizontal component of the location to place the room.
* @param y The vertical component of the location to place the room.
* @return The placement score. The score is inversely proportional to the chance to place the room.
*/
public static int getRoomPlacementScore(Room container, Room room, int x, int y) {
// Check if the room at the given point will fit inside the bounds of the container
if (container.getLeft() > x ||
container.getTop() > y ||
container.getLeft() + container.width < x + room.width ||
container.getTop() + container.height < y + room.height) {
// Room does not fit inside container
return Integer.MAX_VALUE;
}
int roomPlacementScore = 0;
for (int j = 0; j < room.height; j++) {
for (int i = 0; i < room.width; i++) {
Cell cell = room.getCellAt(room.getLeft() + i, room.getTop() + j);
// Translate the room's cell's location to its location in the container
int translatedX = cell.getX() - room.getLeft() + x;
int translatedY = cell.getY() - room.getTop() + y;
// Add 1 point for each adjacent corridor to the cell
for (DirectionType direction : DirectionType.values()) {
if (container.isAdjacentCellCorridor(translatedX, translatedY, direction)) {
roomPlacementScore++;
}
}
// Add 3 points if the cell overlaps an existing corridor
if (container.getCellAt(translatedX, translatedY).isCorridor()) {
roomPlacementScore += 3;
}
// Add 100 points if the cell overlaps any existing room cells
List<Room> existingRooms = container.getRooms();
for (Room existingRoom : existingRooms) {
if (!existingRoom.isOutOfBounds(translatedX, translatedY)) {
roomPlacementScore += 100;
}
}
}
}
return roomPlacementScore;
}
/**
* Creates rooms of random dimensions bounded by the input parameters in the specified containing room.
*
* @param container The containing room.
* @param numRooms The number of rooms to create.
*/
public void createRooms(Room container, int numRooms) {
for (int roomCounter = 0; roomCounter < numRooms; roomCounter++) {
int width = Randomizer.getInstance().nextInt(minWidth, maxWidth);
int height = Randomizer.getInstance().nextInt(minHeight, maxHeight);
Room room = Room.createWalledInRoom(0, 0, width, height);
int bestScore = Integer.MAX_VALUE;
int bestX = -1;
int bestY = -1;
// Ensure that rooms are always created adjacent to a corridor
List<Cell> corridorCells = container.getCorridorCells();
if (corridorCells.isEmpty()) {
throw new IllegalStateException("Cannot place rooms if map has no corridors!");
}
for (Cell cell : corridorCells) {
int currentRoomPlacementScore = getRoomPlacementScore(container, room, cell.getX(), cell.getY());
if (currentRoomPlacementScore < bestScore) {
bestScore = currentRoomPlacementScore;
bestX = cell.getX();
bestY = cell.getY();
}
}
if (bestX < 0 || bestY < 0) {
throw new IllegalStateException("Room placement point should have been initialized!");
}
// Create room at best room placement cell
container.addRoom(room, bestX, bestY);
}
}
/**
* Creates doors in the specified room.
*
* @param room The room.
*/
static void createDoors(Room room) {
List<Room> rooms = room.getRooms();
for (Room innerRoom : rooms) {
int left = innerRoom.getLeft();
int top = innerRoom.getTop();
Iterable<Cell> cells = innerRoom.getCells();
for (Cell cell : cells) {
int x = cell.getX();
int y = cell.getY();
// Check if we are on the boundaries of our room and if there is a corridor in that direction
if (y == top && room.isAdjacentCellCorridor(cell, DirectionType.NORTH)) {
room.setCellSide(cell, DirectionType.NORTH, SideType.DOOR);
}
if (x == left && room.isAdjacentCellCorridor(cell, DirectionType.WEST)) {
room.setCellSide(cell, DirectionType.WEST, SideType.DOOR);
}
if (y == top + innerRoom.height - 1 && room.isAdjacentCellCorridor(cell, DirectionType.SOUTH)) {
room.setCellSide(cell, DirectionType.SOUTH, SideType.DOOR);
}
if (x == left + innerRoom.width - 1 && room.isAdjacentCellCorridor(cell, DirectionType.EAST)) {
room.setCellSide(cell, DirectionType.EAST, SideType.DOOR);
}
// Discard any redundant doors that surround this cell's location
removeRedundantDoors(room, cell);
}
}
}
/**
* Removes redundant doors around the specified cell.
*
* @param room The room containing the cell.
* @param cell The cell.
*/
private static void removeRedundantDoors(Room room, Cell cell) {
Cell cellNorth = room.getAdjacentCell(cell, DirectionType.NORTH);
Cell cellWest = room.getAdjacentCell(cell, DirectionType.WEST);
Cell cellSouth = room.getAdjacentCell(cell, DirectionType.SOUTH);
Cell cellEast = room.getAdjacentCell(cell, DirectionType.EAST);
// Remove redundant north side doors
if (cell.getSide(DirectionType.NORTH) == SideType.DOOR) {
if (cellNorth == null) {
throw new IllegalStateException("The cell to the north cannot possibly be null if the north side of the current cell is a door!");
}
// If there is a cell to the west of the reference cell,
// check if that cell has a door to the north
if (cellWest != null && cellWest.getSide(DirectionType.NORTH) == SideType.DOOR) {
// Check if cell to the north of the current cell is a corridor to the west
if (room.isAdjacentCellCorridor(cellNorth, DirectionType.WEST)) {
// Remove redundant door in west cell
room.setCellSide(cellWest, DirectionType.NORTH, SideType.WALL);
}
}
// If there is a cell to the east of the reference cell,
// check if that cell has a door to the north
if (cellEast != null && cellEast.getSide(DirectionType.NORTH) == SideType.DOOR) {
// Check if cell to the north of the current cell is a corridor to the east
if (room.isAdjacentCellCorridor(cellNorth, DirectionType.EAST)) {
// Remove redundant door in east cell
room.setCellSide(cellEast, DirectionType.NORTH, SideType.WALL);
}
}
}
// Remove redundant south side doors
if (cell.getSide(DirectionType.SOUTH) == SideType.DOOR) {
if (cellSouth == null) {
throw new IllegalStateException("The cell to the south cannot possibly be null if the south side of the current cell is a door!");
}
// If there is a cell to the west of the reference cell,
// check if that cell has a door to the south
if (cellWest != null && cellWest.getSide(DirectionType.SOUTH) == SideType.DOOR) {
// Check if cell to the south of the current cell is a corridor to the west
if (room.isAdjacentCellCorridor(cellSouth, DirectionType.WEST)) {
// Remove redundant door in west cell
room.setCellSide(cellWest, DirectionType.SOUTH, SideType.WALL);
}
}
// If there is a cell to the east of the reference cell, check if that
// cell has a door to the south
if (cellEast != null && cellEast.getSide(DirectionType.SOUTH) == SideType.DOOR) {
// Check if cell to the south of the current cell is a corridor to the east
if (room.isAdjacentCellCorridor(cellSouth, DirectionType.EAST)) {
// Remove redundant door in east cell
room.setCellSide(cellEast, DirectionType.SOUTH, SideType.WALL);
}
}
}
// Remove redundant west side doors
if (cell.getSide(DirectionType.WEST) == SideType.DOOR) {
if (cellWest == null) {
throw new IllegalStateException("The cell to the west cannot possibly be null if the west side of the current cell is a door!");
}
// If there is a cell to the north of the reference cell,
// check if that cell has a door to the west
if (cellNorth != null && cellNorth.getSide(DirectionType.WEST) == SideType.DOOR) {
// Check if cell to the west of the current cell is a corridor to the north
if (room.isAdjacentCellCorridor(cellWest, DirectionType.NORTH)) {
// Remove redundant door in north cell
room.setCellSide(cellNorth, DirectionType.WEST, SideType.WALL);
}
}
// If there is a cell to the south of the reference cell,
// check if that cell has a door to the west
if (cellSouth != null && cellSouth.getSide(DirectionType.WEST) == SideType.DOOR) {
// Check if cell to the west of the current cell is a corridor to the south
if (room.isAdjacentCellCorridor(cellWest, DirectionType.SOUTH)) {
// Remove redundant door in south cell
room.setCellSide(cellSouth, DirectionType.WEST, SideType.WALL);
}
}
}
// Remove redundant east side doors
if (cell.getSide(DirectionType.EAST) == SideType.DOOR) {
if (cellEast == null) {
throw new IllegalStateException("The cell to the east cannot possibly be null if the east side of the current cell is a door!");
}
// If there is a cell to the north of the reference cell,
// check if that cell has a door to the east
if (cellNorth != null && cellNorth.getSide(DirectionType.EAST) == SideType.DOOR) {
// Check if cell to the east of the current cell is a corridor to the north
if (room.isAdjacentCellCorridor(cellEast, DirectionType.NORTH)) {
// Remove redundant door in north cell
room.setCellSide(cellNorth, DirectionType.EAST, SideType.WALL);
}
}
// If there is a cell to the south of the reference cell, check if that
// cell has a door to the east
if (cellSouth != null && cellSouth.getSide(DirectionType.EAST) == SideType.DOOR) {
// Check if cell to the east of the current cell is a corridor to the south
if (room.isAdjacentCellCorridor(cellEast, DirectionType.SOUTH)) {
// Remove redundant door in south cell
room.setCellSide(cellSouth, DirectionType.EAST, SideType.WALL);
}
}
}
}
}
| {
"content_hash": "687f393b6dba70c5a2d69c05130282de",
"timestamp": "",
"source": "github",
"line_count": 284,
"max_line_length": 146,
"avg_line_length": 46.028169014084504,
"alnum_prop": 0.5858323133414932,
"repo_name": "prototypev/android-side-projects",
"id": "a17e208eaaa7f04cb3e5a647816d03bb3ea6b4bc",
"size": "13072",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PermissiveFov/src/prototypev/PermissiveFov/LevelGeneration/Generators/RoomGenerator.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "107735"
}
],
"symlink_target": ""
} |
package com.macro.mall.model;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class UmsMemberTagExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public UmsMemberTagExample() {
oredCriteria = new ArrayList<>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andFinishOrderCountIsNull() {
addCriterion("finish_order_count is null");
return (Criteria) this;
}
public Criteria andFinishOrderCountIsNotNull() {
addCriterion("finish_order_count is not null");
return (Criteria) this;
}
public Criteria andFinishOrderCountEqualTo(Integer value) {
addCriterion("finish_order_count =", value, "finishOrderCount");
return (Criteria) this;
}
public Criteria andFinishOrderCountNotEqualTo(Integer value) {
addCriterion("finish_order_count <>", value, "finishOrderCount");
return (Criteria) this;
}
public Criteria andFinishOrderCountGreaterThan(Integer value) {
addCriterion("finish_order_count >", value, "finishOrderCount");
return (Criteria) this;
}
public Criteria andFinishOrderCountGreaterThanOrEqualTo(Integer value) {
addCriterion("finish_order_count >=", value, "finishOrderCount");
return (Criteria) this;
}
public Criteria andFinishOrderCountLessThan(Integer value) {
addCriterion("finish_order_count <", value, "finishOrderCount");
return (Criteria) this;
}
public Criteria andFinishOrderCountLessThanOrEqualTo(Integer value) {
addCriterion("finish_order_count <=", value, "finishOrderCount");
return (Criteria) this;
}
public Criteria andFinishOrderCountIn(List<Integer> values) {
addCriterion("finish_order_count in", values, "finishOrderCount");
return (Criteria) this;
}
public Criteria andFinishOrderCountNotIn(List<Integer> values) {
addCriterion("finish_order_count not in", values, "finishOrderCount");
return (Criteria) this;
}
public Criteria andFinishOrderCountBetween(Integer value1, Integer value2) {
addCriterion("finish_order_count between", value1, value2, "finishOrderCount");
return (Criteria) this;
}
public Criteria andFinishOrderCountNotBetween(Integer value1, Integer value2) {
addCriterion("finish_order_count not between", value1, value2, "finishOrderCount");
return (Criteria) this;
}
public Criteria andFinishOrderAmountIsNull() {
addCriterion("finish_order_amount is null");
return (Criteria) this;
}
public Criteria andFinishOrderAmountIsNotNull() {
addCriterion("finish_order_amount is not null");
return (Criteria) this;
}
public Criteria andFinishOrderAmountEqualTo(BigDecimal value) {
addCriterion("finish_order_amount =", value, "finishOrderAmount");
return (Criteria) this;
}
public Criteria andFinishOrderAmountNotEqualTo(BigDecimal value) {
addCriterion("finish_order_amount <>", value, "finishOrderAmount");
return (Criteria) this;
}
public Criteria andFinishOrderAmountGreaterThan(BigDecimal value) {
addCriterion("finish_order_amount >", value, "finishOrderAmount");
return (Criteria) this;
}
public Criteria andFinishOrderAmountGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("finish_order_amount >=", value, "finishOrderAmount");
return (Criteria) this;
}
public Criteria andFinishOrderAmountLessThan(BigDecimal value) {
addCriterion("finish_order_amount <", value, "finishOrderAmount");
return (Criteria) this;
}
public Criteria andFinishOrderAmountLessThanOrEqualTo(BigDecimal value) {
addCriterion("finish_order_amount <=", value, "finishOrderAmount");
return (Criteria) this;
}
public Criteria andFinishOrderAmountIn(List<BigDecimal> values) {
addCriterion("finish_order_amount in", values, "finishOrderAmount");
return (Criteria) this;
}
public Criteria andFinishOrderAmountNotIn(List<BigDecimal> values) {
addCriterion("finish_order_amount not in", values, "finishOrderAmount");
return (Criteria) this;
}
public Criteria andFinishOrderAmountBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("finish_order_amount between", value1, value2, "finishOrderAmount");
return (Criteria) this;
}
public Criteria andFinishOrderAmountNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("finish_order_amount not between", value1, value2, "finishOrderAmount");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | {
"content_hash": "f1cdfcf6080cfc4f42b32eac622aa549",
"timestamp": "",
"source": "github",
"line_count": 450,
"max_line_length": 102,
"avg_line_length": 31.02,
"alnum_prop": 0.5848556486854359,
"repo_name": "macrozheng/mall",
"id": "c45777f2bfee40a77d071a9c700216985c230325",
"size": "13959",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "mall-mbg/src/main/java/com/macro/mall/model/UmsMemberTagExample.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "366"
},
{
"name": "Java",
"bytes": "2734172"
},
{
"name": "Shell",
"bytes": "2324"
}
],
"symlink_target": ""
} |
```lua
require "cargo"
default "debug"
desc("Build a debug binary")
task("debug", function()
print "Building debug version..."
cargo.build()
end)
desc("Build a release binary")
task("release", function()
cargo.build {
release = true
}
end)
desc("Clean the project directory")
task("clean", function()
cargo.clean()
end)
desc("Runs tests")
task("test", function()
for _, file in ipairs(glob("tests/*.lua")) do
print("[" .. file .. "]")
local success, err = pcall(function()
return dofile(file)
end)
if not success then
print "FAIL!"
print("Reason: " .. err)
else
print "PASS"
end
end
end)
```
C++ example:
```lua
desc("Build a C++ program")
task("main", {"target/main"})
rule("target/main", cpp.binary {
bin = "target/main",
srcs = glob("src/**"),
libs = {"glibc"},
})
cpp.binary("target/main", {}, {
srcs = glob("src/**"),
libs = {"glibc"},
})
```
| {
"content_hash": "3060f795ef50831ab95ae1e7f92de58d",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 49,
"avg_line_length": 16.866666666666667,
"alnum_prop": 0.5375494071146245,
"repo_name": "coderstephen/rote",
"id": "f6b3b2b373c6822832421a4255ca031696e09d18",
"size": "1024",
"binary": false,
"copies": "1",
"ref": "refs/heads/version-1",
"path": "docs/src/examples.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Lua",
"bytes": "11292"
},
{
"name": "Rust",
"bytes": "82171"
}
],
"symlink_target": ""
} |
/*
* Automatically generated by jrpcgen 1.0.5 on 10/23/08 8:11 PM
* jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
* See http://remotetea.sourceforge.net for details
*/
package info.ganglia.gmetric4j.xdr.v31x;
import org.acplt.oncrpc.*;
import java.io.IOException;
public class Ganglia_gmetric_double implements XdrAble {
public Ganglia_metric_id metric_id;
public String fmt;
public double d;
public Ganglia_gmetric_double() {
}
public Ganglia_gmetric_double(XdrDecodingStream xdr)
throws OncRpcException, IOException {
xdrDecode(xdr);
}
public void xdrEncode(XdrEncodingStream xdr)
throws OncRpcException, IOException {
metric_id.xdrEncode(xdr);
xdr.xdrEncodeString(fmt);
xdr.xdrEncodeDouble(d);
}
public void xdrDecode(XdrDecodingStream xdr)
throws OncRpcException, IOException {
metric_id = new Ganglia_metric_id(xdr);
fmt = xdr.xdrDecodeString();
d = xdr.xdrDecodeDouble();
}
}
// End of Ganglia_gmetric_double.java
| {
"content_hash": "f1f2103b1b6aad2130d7e9f0b597903f",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 63,
"avg_line_length": 28.36842105263158,
"alnum_prop": 0.6790352504638218,
"repo_name": "jongyoul/gmetric4j",
"id": "c744247555fda2b6d8d825c8d097f40c83f994b6",
"size": "1078",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/main/java/info/ganglia/gmetric4j/xdr/v31x/Ganglia_gmetric_double.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1591"
},
{
"name": "Java",
"bytes": "77493"
}
],
"symlink_target": ""
} |
/**
* Information on matched way point
*
* @author ab
*/
package cgeo.geocaching.brouter.core;
final class MessageData implements Cloneable {
public int linkdist = 0;
public int linkelevationcost = 0;
public int linkturncost = 0;
public int linknodecost = 0;
public int linkinitcost = 0;
public float costfactor;
public int priorityclassifier;
public int classifiermask;
public float turnangle;
public String wayKeyValues;
public String nodeKeyValues;
public int lon;
public int lat;
public short ele;
public float time;
public float energy;
// speed profile
public int vmaxExplicit = -1;
public int vmax = -1;
public int vmin = -1;
public int vnode0 = 999;
public int vnode1 = 999;
public int extraTime = 0;
public String toMessage() {
if (wayKeyValues == null) {
return null;
}
final int iCost = (int) (costfactor * 1000 + 0.5f);
return (lon - 180000000) + "\t"
+ (lat - 90000000) + "\t"
+ ele / 4 + "\t"
+ linkdist + "\t"
+ iCost + "\t"
+ linkelevationcost
+ "\t" + linkturncost
+ "\t" + linknodecost
+ "\t" + linkinitcost
+ "\t" + wayKeyValues
+ "\t" + (nodeKeyValues == null ? "" : nodeKeyValues);
}
public void add(final MessageData d) {
linkdist += d.linkdist;
linkelevationcost += d.linkelevationcost;
linkturncost += d.linkturncost;
linknodecost += d.linknodecost;
linkinitcost += d.linkinitcost;
}
public MessageData copy() {
try {
return (MessageData) clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
}
@Override
public String toString() {
return "dist=" + linkdist + " prio=" + priorityclassifier + " turn=" + turnangle;
}
public int getPrio() {
return priorityclassifier;
}
public boolean isBadOneway() {
return (classifiermask & 1) != 0;
}
public boolean isGoodOneway() {
return (classifiermask & 2) != 0;
}
public boolean isRoundabout() {
return (classifiermask & 4) != 0;
}
public boolean isLinktType() {
return (classifiermask & 8) != 0;
}
public boolean isGoodForCars() {
return (classifiermask & 16) != 0;
}
}
| {
"content_hash": "1361285ae226fe2e90bb42946fba4bb6",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 89,
"avg_line_length": 24.205882352941178,
"alnum_prop": 0.5650060753341434,
"repo_name": "matej116/cgeo",
"id": "9b2d57ccda5c907433c173e0b96eb79ec00be84a",
"size": "2469",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "main/src/cgeo/geocaching/brouter/core/MessageData.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "3556803"
},
{
"name": "Java",
"bytes": "5546219"
},
{
"name": "Shell",
"bytes": "8245"
}
],
"symlink_target": ""
} |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deactivate = exports.activate = void 0;
const path = require("path");
const vscode = require("vscode");
const completion_provider_1 = require("./font-awesome/completion-provider");
const documentation_1 = require("./font-awesome/documentation");
const hover_provider_1 = require("./font-awesome/hover-provider");
const version_migrations_1 = require("./version-migrations");
const configuration_1 = require("./font-awesome/configuration");
const disposables = [];
function registerProviders(context) {
// Load config
const config = (0, configuration_1.loadConfiguration)();
// Load icon documentation
const documentation = new documentation_1.default(path.join(path.dirname(__dirname), `data/fontawesome-${config.version}`), config);
const providers = {
completion: new completion_provider_1.default(documentation, config),
hover: new hover_provider_1.default(documentation, config),
};
disposables.push(vscode.languages.registerCompletionItemProvider(config.patterns, providers.completion, ...[config.triggerCharacter]), vscode.languages.registerHoverProvider(config.patterns, providers.hover));
context.subscriptions.push(...disposables);
}
;
function unregisterProviders(context) {
// If the providers are about to be registered again, remove previous instances first
for (const disposable of disposables) {
const existingIndex = context.subscriptions.indexOf(disposable);
if (existingIndex !== -1) {
context.subscriptions.splice(existingIndex, 1);
}
disposable.dispose();
}
}
function clearAndLoadExtension(context) {
unregisterProviders(context);
registerProviders(context);
}
function activate(context) {
// Whenever the configuration changes and affects the extension, reload everything
vscode.workspace.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(configuration_1.configurationSection)) {
clearAndLoadExtension(context);
}
});
clearAndLoadExtension(context);
version_migrations_1.default.RunAll();
}
exports.activate = activate;
function deactivate() {
}
exports.deactivate = deactivate;
//# sourceMappingURL=extension.js.map | {
"content_hash": "d32a21b6759041acb89f50ed42a4668d",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 213,
"avg_line_length": 44.22641509433962,
"alnum_prop": 0.7128839590443686,
"repo_name": "ealbertos/dotfiles",
"id": "87eba7f505c65689b9f9616efc386a718c722107",
"size": "2344",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vscode.symlink/extensions/janne252.fontawesome-autocomplete-1.3.1/out/extension.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "99972"
},
{
"name": "EJS",
"bytes": "2437"
},
{
"name": "HTML",
"bytes": "47081"
},
{
"name": "JavaScript",
"bytes": "3546995"
},
{
"name": "Less",
"bytes": "183"
},
{
"name": "Python",
"bytes": "134723"
},
{
"name": "Ruby",
"bytes": "127567"
},
{
"name": "Shell",
"bytes": "34790"
},
{
"name": "TSQL",
"bytes": "258"
},
{
"name": "TypeScript",
"bytes": "37162"
},
{
"name": "Vim Script",
"bytes": "60888"
},
{
"name": "Vim Snippet",
"bytes": "11523"
}
],
"symlink_target": ""
} |
<html>
<head>
<!--#include virtual="/base.html" -->
<link rel="stylesheet" href="css/all.css"/>
<!--#include virtual="/title.html" -->
</head>
<body>
<div class="redirectPageMessage">Sorry! You are not allowed to be here :(</div>
</body>
</html>
| {
"content_hash": "56502662d52c30ef3df93e2d4c32bbf3",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 83,
"avg_line_length": 26.2,
"alnum_prop": 0.6030534351145038,
"repo_name": "gpolitis/jitsi-meet",
"id": "e12558ac9f95d2cc04f53d1ce32a1567c012c6e9",
"size": "262",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "static/authError.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "829"
},
{
"name": "HTML",
"bytes": "20912"
},
{
"name": "Java",
"bytes": "240787"
},
{
"name": "JavaScript",
"bytes": "5029101"
},
{
"name": "Lua",
"bytes": "259075"
},
{
"name": "Makefile",
"bytes": "4018"
},
{
"name": "Objective-C",
"bytes": "132652"
},
{
"name": "Ruby",
"bytes": "6904"
},
{
"name": "SCSS",
"bytes": "160699"
},
{
"name": "Shell",
"bytes": "30753"
},
{
"name": "Starlark",
"bytes": "152"
},
{
"name": "Swift",
"bytes": "63112"
},
{
"name": "TypeScript",
"bytes": "87689"
}
],
"symlink_target": ""
} |
import logger from '../logger';
/**
* Background task that continually re-publishes a JSON value to
* the specified hash key in Redis with an updated timestamp.
*/
class PoolEntryUpdater {
/**
* Create a new PoolEntryUpdater.
*
* @param {RedisClient} redisClient Redis client to use for updating
* @param {string} hash Redis hash to publish to
* @param {string} key key to publish to within the hash
* @param {Object} value JSON value to publish
* @param {number} interval optional refresh interval, in seconds
* (default = 9)
*/
constructor(redisClient, hash, key, value, interval = 9) {
this.redisClient = redisClient;
this.hash = hash;
this.key = key;
this.value = value;
this.interval = interval * 1000;
}
/**
* Start the recurring update task.
*/
start() {
this.stop();
this.updateInterval = setInterval(this.update.bind(this), this.interval);
this.update();
}
/**
* Stop the recurring update task.
*/
stop() {
clearInterval(this.updateInterval);
}
update() {
this.value.lastUpdated = Date.now();
this.redisClient.hsetAsync(this.hash, this.key, JSON.stringify(this.value))
.catch(error => {
logger.error(`PoolEntryUpdater::update() failed: ${error}`);
});
}
}
export default PoolEntryUpdater;
| {
"content_hash": "561848c91162a63cef2940d3ea9d431f",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 84,
"avg_line_length": 28.705882352941178,
"alnum_prop": 0.592896174863388,
"repo_name": "CyTube/cytube-common",
"id": "02e7de73eab35150280c3afa0fcd2775a7208dbb",
"size": "1464",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/redis/poolentryupdater.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "40190"
},
{
"name": "Lua",
"bytes": "1692"
}
],
"symlink_target": ""
} |
layout: page
title: 目录
description: "文档列表"
header-img: "img/tree.jpg"
---
<div id="post-list">
{% for tag in site.tags %}
<h2 id="{{ tag[0] }}">{{ tag[0] | capitalize }}</h2>
<ul class="post-list">
{% assign pages_list = tag[1] %}
{% for post in pages_list %}
{% if post.title != null %}
{% if group == null or group == post.group %}
<li><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}<span class="entry-date"> ~ <time datetime="{{ post.date | date_to_xmlschema }}" itemprop="datePublished">{{ post.date | date: "%b %d, %Y" }}</time></a></li>
{% endif %}
{% endif %}
{% endfor %}
{% assign pages_list = nil %}
{% assign group = nil %}
</ul>
{% endfor %}
</div>
| {
"content_hash": "f8986efaaee5af83346dfc40170864da",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 220,
"avg_line_length": 28.125,
"alnum_prop": 0.5733333333333334,
"repo_name": "xiaojinggang/xiaojinggang.github.io",
"id": "3cef5900cb0003f82eced252bfe97ddb42771f40",
"size": "691",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tags.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "22691"
},
{
"name": "HTML",
"bytes": "20017"
},
{
"name": "JavaScript",
"bytes": "53786"
}
],
"symlink_target": ""
} |
package com.realcomp.prime.transform;
import com.realcomp.prime.MultiFieldOperation;
import com.realcomp.prime.Operation;
import com.realcomp.prime.conversion.ConversionException;
import com.realcomp.prime.record.RecordValueAssembler;
import com.realcomp.prime.record.RecordValueException;
import com.realcomp.prime.schema.Field;
import com.realcomp.prime.schema.FieldList;
import com.realcomp.prime.schema.xml.FieldListConverter;
import com.realcomp.prime.validation.ValidationException;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
@XStreamAlias("transform")
@XmlRootElement
public class Transformer{
private static final Logger logger = Logger.getLogger(Transformer.class.getName());
private List<Operation> before;
private List<Operation> after;
@XStreamConverter(FieldListConverter.class)
private FieldList fields;
private ValueSurgeon surgeon;
public Transformer(){
fields = new FieldList();
surgeon = new ValueSurgeon();
}
public Transformer(Transformer copy){
super();
if (copy.before != null){
setBefore(copy.before);
}
if (copy.after != null){
setAfter(copy.after);
}
setFields(copy.fields);
}
public void transform(TransformContext context) throws ConversionException, ValidationException{
if (surgeon == null){
surgeon = new ValueSurgeon();
}
context.setFields(fields);
for (Field field : fields){
context.setKey(field.getName());
if (surgeon == null){
throw new IllegalStateException("surgeon is null");
}
Object result = surgeon.operate(getOperations(field), context);
if (result != null){
if (field.getType() == null){
throw new IllegalStateException("Field [" + field.getName() + "] does not have a type");
}
result = field.getType().coerce(result);
}
try{
RecordValueAssembler.assemble(context.getRecord(), field.getName(), result);
}
catch (RecordValueException ex){
throw new ConversionException(ex);
}
}
}
protected List<Operation> getOperations(Field field){
List<Operation> operations = new ArrayList<>();
if (before != null){
operations.addAll(before);
}
operations.addAll(field.getOperations());
if (after != null){
operations.addAll(after);
}
return operations;
}
public void addField(Field field){
fields.add(new Field(field));
}
public FieldList getFields(){
return fields;
}
public void setFields(FieldList fields){
if (fields == null){
throw new IllegalArgumentException("fields is null");
}
this.fields.clear();
this.fields = new FieldList(fields);
}
/**
* @return all Operations to perform on all Fields after all Field specific operations are finished, or null if none
* specified.
*
*/
public List<Operation> getAfter(){
return after;
}
/**
* Set all Operations to perform on all Fields after all Field specific operations are finished.
*
* @param after null will clear existing list
*/
public void setAfter(List<Operation> after){
if (after == null){
this.after = null;
}
else{
if (this.after != null){
this.after.clear();
}
for (Operation op : after){
addAfter(op);
}
}
}
/**
* Add an Operation to the after operations group, to be run after all Field specific Operations are performed.
*
* @param op not null
*/
public void addAfter(Operation op){
if (op == null){
throw new IllegalArgumentException("op is null");
}
if (after == null){
after = new ArrayList<Operation>();
}
this.after.add(op);
}
/**
*
* @return all Operations to perform on all Fields before any Field specific Operations are performed, or null if
* none specified.
*/
public List<Operation> getBefore(){
return before;
}
/**
* Set all Operations to perform on all Fields before any Field specific Operations are performed.
*
* @param before null will clear list
*/
public void setBefore(List<Operation> before){
if (before == null){
this.before = null;
}
else{
if (this.before != null){
this.before.clear();
}
for (Operation op : before){
addBefore(op);
}
}
}
/**
* Add an Operation to the before operations group, to be run before all Field specific Operations are performed.
*
* @param op not null, not a MultiFieldOperation
*/
public void addBefore(Operation op){
if (op == null){
throw new IllegalArgumentException("op is null");
}
if (op instanceof MultiFieldOperation){
throw new IllegalArgumentException(
"You cannot specify a MultiFieldOperation as a 'before' operation");
}
if (before == null){
before = new ArrayList<Operation>();
}
this.before.add(op);
}
@Override
public boolean equals(Object obj){
if (obj == null){
return false;
}
if (getClass() != obj.getClass()){
return false;
}
final Transformer other = (Transformer) obj;
if (this.before != other.before && (this.before == null || !this.before.equals(other.before))){
return false;
}
if (this.after != other.after && (this.after == null || !this.after.equals(other.after))){
return false;
}
return this.fields == other.fields || (this.fields != null && this.fields.equals(other.fields));
}
@Override
public int hashCode(){
int hash = 5;
hash = 83 * hash + (this.before != null ? this.before.hashCode() : 0);
hash = 83 * hash + (this.after != null ? this.after.hashCode() : 0);
hash = 83 * hash + (this.fields != null ? this.fields.hashCode() : 0);
return hash;
}
}
| {
"content_hash": "87656f875ea1150d26fa3c72fc3ac40b",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 120,
"avg_line_length": 29.10822510822511,
"alnum_prop": 0.5806067816775728,
"repo_name": "real-comp/prime",
"id": "f52f66dafb927878d8ffcced646e8c93eee14fc8",
"size": "6724",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/realcomp/prime/transform/Transformer.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "558645"
}
],
"symlink_target": ""
} |
package com.intellij.facet.ui.libraries;
import com.intellij.openapi.util.Comparing;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class LibraryDownloadInfo {
@Nullable private final RemoteRepositoryInfo myRemoteRepository;
private final String myRelativeDownloadUrl;
private final String myFileNamePrefix;
private final String myFileNameSuffix;
@Nullable private final String myPresentableUrl;
public LibraryDownloadInfo(final @NotNull RemoteRepositoryInfo remoteRepository,
final @NotNull @NonNls String relativeDownloadUrl,
final @NotNull @NonNls String fileNamePrefix,
final @NotNull @NonNls String fileNameSuffix) {
myRemoteRepository = remoteRepository;
myRelativeDownloadUrl = relativeDownloadUrl;
myFileNamePrefix = fileNamePrefix;
myFileNameSuffix = fileNameSuffix;
myPresentableUrl = null;
}
public LibraryDownloadInfo(final @NotNull String downloadUrl, final @Nullable String presentableUrl,
@NotNull @NonNls String fileNamePrefix, @NotNull @NonNls String fileNameSuffix) {
myRemoteRepository = null;
myRelativeDownloadUrl = downloadUrl;
myFileNamePrefix = fileNamePrefix;
myFileNameSuffix = fileNameSuffix;
myPresentableUrl = presentableUrl != null ? presentableUrl : downloadUrl;
}
public LibraryDownloadInfo(final @NotNull String downloadUrl, final @Nullable String presentableUrl,
@NotNull @NonNls String fileNamePrefix) {
this(downloadUrl, presentableUrl, fileNamePrefix, ".jar");
}
public LibraryDownloadInfo(final @NotNull String downloadUrl, @NotNull @NonNls String fileNamePrefix) {
this(downloadUrl, null, fileNamePrefix);
}
@NotNull
public String getDownloadUrl() {
return myRemoteRepository != null ? getDownloadUrl(myRemoteRepository.getDefaultMirror()) : myRelativeDownloadUrl;
}
@NotNull
public String getDownloadUrl(String mirror) {
return mirror + myRelativeDownloadUrl;
}
@Nullable
public RemoteRepositoryInfo getRemoteRepository() {
return myRemoteRepository;
}
@NotNull
public String getFileNamePrefix() {
return myFileNamePrefix;
}
@NotNull
public String getFileNameSuffix() {
return myFileNameSuffix;
}
@NotNull
public String getFileName() {
return myFileNamePrefix + myFileNameSuffix;
}
@NotNull
public String getPresentableUrl() {
return myPresentableUrl != null ? myPresentableUrl
: myRemoteRepository != null ? myRemoteRepository.getDefaultMirror() : myRelativeDownloadUrl;
}
@NotNull
public String getPresentableUrl(String mirror) {
return myPresentableUrl != null ? myPresentableUrl : mirror;
}
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final LibraryDownloadInfo that = (LibraryDownloadInfo)o;
if (!myFileNamePrefix.equals(that.myFileNamePrefix)) return false;
if (!myFileNameSuffix.equals(that.myFileNameSuffix)) return false;
if (!Comparing.equal(myPresentableUrl, that.myPresentableUrl)) return false;
if (!myRelativeDownloadUrl.equals(that.myRelativeDownloadUrl)) return false;
if (!Comparing.equal(myRemoteRepository, that.myRemoteRepository)) return false;
return true;
}
public int hashCode() {
int result = myRemoteRepository != null ? myRemoteRepository.hashCode() : 0;
result = 31 * result + (myRelativeDownloadUrl != null ? myRelativeDownloadUrl.hashCode() : 0);
result = 31 * result + (myFileNamePrefix != null ? myFileNamePrefix.hashCode() : 0);
result = 31 * result + (myFileNameSuffix != null ? myFileNameSuffix.hashCode() : 0);
result = 31 * result + (myPresentableUrl != null ? myPresentableUrl.hashCode() : 0);
return result;
}
}
| {
"content_hash": "de138c03d2eec81766f080551cb5befd",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 118,
"avg_line_length": 36.03636363636364,
"alnum_prop": 0.7247729566094854,
"repo_name": "leafclick/intellij-community",
"id": "ac963dedf4312a33200b142a832ac8753ca6e9ca",
"size": "4564",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "platform/lang-api/src/com/intellij/facet/ui/libraries/LibraryDownloadInfo.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.4) on Wed Feb 17 15:34:46 CET 2021 -->
<title>Uses of Interface se.litsec.eidas.opensaml.ext.attributes.address.Thoroughfare (eIDAS extension for OpenSAML 4.x - 2.0.1)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2021-02-17">
<link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Interface se.litsec.eidas.opensaml.ext.attributes.address.Thoroughfare (eIDAS extension for OpenSAML 4.x - 2.0.1)";
}
}
catch(err) {
}
//-->
var pathtoroot = "../../../../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../index.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../Thoroughfare.html" title="interface in se.litsec.eidas.opensaml.ext.attributes.address">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../../allclasses.html">All Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<main role="main">
<div class="header">
<h2 title="Uses of Interface se.litsec.eidas.opensaml.ext.attributes.address.Thoroughfare" class="title">Uses of Interface<br>se.litsec.eidas.opensaml.ext.attributes.address.Thoroughfare</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary">
<caption><span>Packages that use <a href="../Thoroughfare.html" title="interface in se.litsec.eidas.opensaml.ext.attributes.address">Thoroughfare</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<th class="colFirst" scope="row"><a href="#se.litsec.eidas.opensaml.ext.attributes.address.impl">se.litsec.eidas.opensaml.ext.attributes.address.impl</a></th>
<td class="colLast">
<div class="block">Implementation classes for the supporting types of the eIDAS <code>CurrentAddressStructuredType</code>.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList">
<section role="region"><a id="se.litsec.eidas.opensaml.ext.attributes.address.impl">
<!-- -->
</a>
<h3>Uses of <a href="../Thoroughfare.html" title="interface in se.litsec.eidas.opensaml.ext.attributes.address">Thoroughfare</a> in <a href="../impl/package-summary.html">se.litsec.eidas.opensaml.ext.attributes.address.impl</a></h3>
<table class="useSummary">
<caption><span>Classes in <a href="../impl/package-summary.html">se.litsec.eidas.opensaml.ext.attributes.address.impl</a> that implement <a href="../Thoroughfare.html" title="interface in se.litsec.eidas.opensaml.ext.attributes.address">Thoroughfare</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../impl/ThoroughfareImpl.html" title="class in se.litsec.eidas.opensaml.ext.attributes.address.impl">ThoroughfareImpl</a></span></code></th>
<td class="colLast">
<div class="block">Implementation of <code>Thoroughfare</code>.</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary">
<caption><span>Methods in <a href="../impl/package-summary.html">se.litsec.eidas.opensaml.ext.attributes.address.impl</a> that return <a href="../Thoroughfare.html" title="interface in se.litsec.eidas.opensaml.ext.attributes.address">Thoroughfare</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../Thoroughfare.html" title="interface in se.litsec.eidas.opensaml.ext.attributes.address">Thoroughfare</a></code></td>
<th class="colSecond" scope="row"><span class="typeNameLabel">ThoroughfareBuilder.</span><code><span class="memberNameLink"><a href="../impl/ThoroughfareBuilder.html#buildObject()">buildObject</a></span>()</code></th>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../Thoroughfare.html" title="interface in se.litsec.eidas.opensaml.ext.attributes.address">Thoroughfare</a></code></td>
<th class="colSecond" scope="row"><span class="typeNameLabel">ThoroughfareBuilder.</span><code><span class="memberNameLink"><a href="../impl/ThoroughfareBuilder.html#buildObject(java.lang.String,java.lang.String,java.lang.String)">buildObject</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> namespaceURI,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> localName,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> namespacePrefix)</code></th>
</tr>
</tbody>
</table>
</section>
</li>
</ul>
</li>
</ul>
</div>
</main>
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../index.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../Thoroughfare.html" title="interface in se.litsec.eidas.opensaml.ext.attributes.address">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../../allclasses.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright © 2021 <a href="http://www.litsec.se">Litsec AB</a>. All rights reserved.</small></p>
</footer>
</body>
</html>
| {
"content_hash": "450768effbc6fa28bc8da9d4675aed98",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 461,
"avg_line_length": 44.91284403669725,
"alnum_prop": 0.6553978143192728,
"repo_name": "litsec/eidas-opensaml",
"id": "2d8415eb9baeb7619b2645cca83357c88a107342",
"size": "9791",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/javadoc/opensaml4/2.0.1/se/litsec/eidas/opensaml/ext/attributes/address/class-use/Thoroughfare.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1028453"
}
],
"symlink_target": ""
} |
/*
* Camel ApiMethod Enumeration generated by camel-api-component-maven-plugin
*/
package org.apache.camel.component.google.drive.internal;
import java.lang.reflect.Method;
import java.util.List;
import com.google.api.services.drive.Drive.Channels;
import org.apache.camel.support.component.ApiMethod;
import org.apache.camel.support.component.ApiMethodArg;
import org.apache.camel.support.component.ApiMethodImpl;
import static org.apache.camel.support.component.ApiMethodArg.arg;
/**
* Camel {@link ApiMethod} Enumeration for com.google.api.services.drive.Drive$Channels
*/
public enum DriveChannelsApiMethod implements ApiMethod {
STOP(
com.google.api.services.drive.Drive.Channels.Stop.class,
"stop",
arg("contentChannel", com.google.api.services.drive.model.Channel.class));
private final ApiMethod apiMethod;
private DriveChannelsApiMethod(Class<?> resultType, String name, ApiMethodArg... args) {
this.apiMethod = new ApiMethodImpl(Channels.class, resultType, name, args);
}
@Override
public String getName() { return apiMethod.getName(); }
@Override
public Class<?> getResultType() { return apiMethod.getResultType(); }
@Override
public List<String> getArgNames() { return apiMethod.getArgNames(); }
@Override
public List<Class<?>> getArgTypes() { return apiMethod.getArgTypes(); }
@Override
public Method getMethod() { return apiMethod.getMethod(); }
}
| {
"content_hash": "c3a3b1c8468cd6b987fa51e2d4d88c6a",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 92,
"avg_line_length": 29.48,
"alnum_prop": 0.73202170963365,
"repo_name": "ullgren/camel",
"id": "7c757901d98444ecf06ddad138b4ef497880cd40",
"size": "1474",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "components/camel-google-drive/src/generated/java/org/apache/camel/component/google/drive/internal/DriveChannelsApiMethod.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Apex",
"bytes": "6519"
},
{
"name": "Batchfile",
"bytes": "1518"
},
{
"name": "CSS",
"bytes": "16394"
},
{
"name": "Elm",
"bytes": "10852"
},
{
"name": "FreeMarker",
"bytes": "11410"
},
{
"name": "Groovy",
"bytes": "14490"
},
{
"name": "HTML",
"bytes": "896075"
},
{
"name": "Java",
"bytes": "69929414"
},
{
"name": "JavaScript",
"bytes": "90399"
},
{
"name": "Makefile",
"bytes": "513"
},
{
"name": "Shell",
"bytes": "17108"
},
{
"name": "Tcl",
"bytes": "4974"
},
{
"name": "Thrift",
"bytes": "6979"
},
{
"name": "XQuery",
"bytes": "546"
},
{
"name": "XSLT",
"bytes": "270186"
}
],
"symlink_target": ""
} |
require 'test_helper'
class WsHelperTest < ActionView::TestCase
end
| {
"content_hash": "cf21ac4af889b93d4926e509df607270",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 41,
"avg_line_length": 17.25,
"alnum_prop": 0.7971014492753623,
"repo_name": "kryss/whilewechat",
"id": "0d5b452cb5da4c4c98704e8281a0509011964042",
"size": "69",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "rails_app/test/helpers/ws_helper_test.rb",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "852498"
},
{
"name": "CoffeeScript",
"bytes": "1084"
},
{
"name": "JavaScript",
"bytes": "454974"
},
{
"name": "Ruby",
"bytes": "55689"
}
],
"symlink_target": ""
} |
const gulp = require('gulp');
const changeLog = require('gulp-conventional-changelog');
const typedoc = require('gulp-typedoc');
gulp.task('changelog', () => {
return gulp.src('CHANGELOG.md', { buffer: false })
.pipe(changeLog({
preset: 'angular',
releaseCount: 1
}, {
currentTag: require('./package.json').version
}))
.pipe(gulp.dest('./'));
});
gulp.task('docs', () => {
return gulp.src([ 'index.ts', '!node_modules/**/*' ])
.pipe(typedoc({
name: 'Angular4 Webpack Starter',
mode: 'file',
out: 'docs',
ignoreCompilerErrors: true,
experimentalDecorators: true,
emitDecoratorMetadata: true,
target: 'ES5',
moduleResolution: 'node',
preserveConstEnums: true,
stripInternal: true,
suppressExcessPropertyErrors: true,
suppressImplicitAnyIndexErrors: true,
module: 'commonjs',
ignoreCompilerErrors: true,
noLib: true
}));
});
| {
"content_hash": "e95a3016fdc2477cb8211470a080fbc2",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 57,
"avg_line_length": 26.685714285714287,
"alnum_prop": 0.6263383297644539,
"repo_name": "nzick/angular4-webpack-starter",
"id": "ba2e1aa2165fcdf77763489f3f213d488eaa54ec",
"size": "934",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gulpfile.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "46"
},
{
"name": "HTML",
"bytes": "456"
},
{
"name": "JavaScript",
"bytes": "15115"
},
{
"name": "TypeScript",
"bytes": "4567"
}
],
"symlink_target": ""
} |
netsh http add urlacl url=http://+:58000/ user=<domain\user> | {
"content_hash": "7e4eb462597fc8bc136b578695b6efad",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 64,
"avg_line_length": 64,
"alnum_prop": 0.6875,
"repo_name": "ProximoSrl/Jarvis.GestionePrenotazioni",
"id": "d7489f37821611341a43f98fdc1e1821e63f1560",
"size": "90",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "wiki/dev/network.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "373"
},
{
"name": "C#",
"bytes": "98400"
},
{
"name": "HTML",
"bytes": "581"
}
],
"symlink_target": ""
} |
#include <linux/slab.h>
#include <linux/msm_ion.h>
#include <linux/types.h>
#include <linux/msm_iommu_domains.h>
#include "msm_vidc_resources.h"
#include "msm_vidc_debug.h"
struct smem_client {
int mem_type;
void *clnt;
struct msm_vidc_platform_resources *res;
};
static u32 get_tz_usage(struct smem_client *client, enum hal_buffer buffer_type)
{
int i;
struct buffer_usage_set *buffer_usage_set;
struct buffer_usage_table *buffer_usage_tbl;
buffer_usage_set = &client->res->buffer_usage_set;
if (!buffer_usage_set) {
dprintk(VIDC_DBG, "no buffer usage set present!\n");
return 0;
}
for (i = 0; i < buffer_usage_set->count; i++) {
buffer_usage_tbl = &buffer_usage_set->buffer_usage_tbl[i];
if (buffer_usage_tbl->buffer_type & buffer_type)
return buffer_usage_tbl->tz_usage;
}
dprintk(VIDC_DBG, "No tz usage found for buffer type: %x\n",
buffer_type);
return 0;
}
static int get_device_address(struct smem_client *smem_client,
struct ion_handle *hndl, unsigned long align,
dma_addr_t *iova, unsigned long *buffer_size,
u32 flags, enum hal_buffer buffer_type)
{
int rc = 0;
int domain, partition;
struct ion_client *clnt = NULL;
if (!iova || !buffer_size || !hndl || !smem_client) {
dprintk(VIDC_ERR, "Invalid params: %p, %p, %p, %p\n",
smem_client, hndl, iova, buffer_size);
return -EINVAL;
}
clnt = smem_client->clnt;
if (!clnt) {
dprintk(VIDC_ERR, "Invalid client\n");
return -EINVAL;
}
rc = msm_smem_get_domain_partition(smem_client, flags, buffer_type,
&domain, &partition);
if (rc) {
dprintk(VIDC_ERR, "Failed to get domain and partition: %d\n",
rc);
goto mem_domain_get_failed;
}
if (flags & SMEM_SECURE) {
rc = msm_ion_secure_buffer(clnt, hndl,
get_tz_usage(smem_client, buffer_type), 0);
if (rc) {
dprintk(VIDC_ERR, "Failed to secure memory\n");
goto mem_domain_get_failed;
}
}
if (is_iommu_present(smem_client->res)) {
dprintk(VIDC_DBG,
"Calling ion_map_iommu - domain: %d, partition: %d\n",
domain, partition);
rc = ion_map_iommu(clnt, hndl, domain, partition, align,
0, iova, buffer_size, 0, 0);
} else {
dprintk(VIDC_DBG, "Using physical memory address\n");
rc = ion_phys(clnt, hndl, iova, (size_t *)buffer_size);
}
if (rc) {
dprintk(VIDC_ERR, "ion memory map failed - %d\n", rc);
goto mem_map_failed;
}
return 0;
mem_map_failed:
if (flags & SMEM_SECURE)
msm_ion_unsecure_buffer(clnt, hndl);
mem_domain_get_failed:
return rc;
}
static void put_device_address(struct smem_client *smem_client,
struct ion_handle *hndl, int domain_num, int partition_num, u32 flags)
{
struct ion_client *clnt = NULL;
if (!hndl || !smem_client) {
dprintk(VIDC_WARN, "Invalid params: %p, %p\n",
smem_client, hndl);
return;
}
clnt = smem_client->clnt;
if (!clnt) {
dprintk(VIDC_WARN, "Invalid client\n");
return;
}
if (is_iommu_present(smem_client->res)) {
dprintk(VIDC_DBG,
"Calling ion_unmap_iommu - domain: %d, parition: %d\n",
domain_num, partition_num);
ion_unmap_iommu(clnt, hndl, domain_num, partition_num);
}
if (flags & SMEM_SECURE) {
if (msm_ion_unsecure_buffer(clnt, hndl))
dprintk(VIDC_ERR, "Failed to unsecure memory\n");
}
}
static int ion_user_to_kernel(struct smem_client *client, int fd, u32 offset,
struct msm_smem *mem, enum hal_buffer buffer_type)
{
struct ion_handle *hndl;
dma_addr_t iova = 0;
unsigned long buffer_size = 0;
unsigned long ionflags = 0;
int rc = 0;
int align = SZ_4K;
hndl = ion_import_dma_buf(client->clnt, fd);
if (IS_ERR_OR_NULL(hndl)) {
dprintk(VIDC_ERR, "Failed to get handle: %p, %d, %d, %p\n",
client, fd, offset, hndl);
rc = -ENOMEM;
goto fail_import_fd;
}
mem->kvaddr = NULL;
rc = ion_handle_get_flags(client->clnt, hndl, &ionflags);
if (rc) {
dprintk(VIDC_ERR, "Failed to get ion flags: %d\n", rc);
goto fail_device_address;
}
mem->flags = ionflags;
mem->buffer_type = buffer_type;
if (mem->flags & SMEM_SECURE)
align = ALIGN(align, SZ_1M);
rc = get_device_address(client, hndl, align, &iova, &buffer_size,
mem->flags, buffer_type);
if (rc) {
dprintk(VIDC_ERR, "Failed to get device address: %d\n", rc);
goto fail_device_address;
}
mem->mem_type = client->mem_type;
mem->smem_priv = hndl;
mem->device_addr = iova;
mem->size = buffer_size;
dprintk(VIDC_DBG,
"%s: ion_handle = 0x%p, fd = %d, device_addr = 0x%x, size = %d, kvaddr = 0x%p, buffer_type = %d\n",
__func__, mem->smem_priv, fd, (u32)mem->device_addr,
mem->size, mem->kvaddr, mem->buffer_type);
return rc;
fail_device_address:
ion_free(client->clnt, hndl);
fail_import_fd:
return rc;
}
static int alloc_ion_mem(struct smem_client *client, size_t size, u32 align,
u32 flags, enum hal_buffer buffer_type, struct msm_smem *mem,
int map_kernel)
{
struct ion_handle *hndl;
dma_addr_t iova = 0;
unsigned long buffer_size = 0;
unsigned long heap_mask = 0;
int rc = 0;
align = ALIGN(align, SZ_4K);
size = ALIGN(size, SZ_4K);
if (flags & SMEM_SECURE) {
size = ALIGN(size, SZ_1M);
align = ALIGN(align, SZ_1M);
}
if (is_iommu_present(client->res)) {
heap_mask = ION_HEAP(ION_IOMMU_HEAP_ID);
} else {
dprintk(VIDC_DBG,
"allocate shared memory from adsp heap size %d align %d\n",
size, align);
heap_mask = ION_HEAP(ION_ADSP_HEAP_ID);
}
if (flags & SMEM_SECURE)
heap_mask = ION_HEAP(ION_CP_MM_HEAP_ID);
hndl = ion_alloc(client->clnt, size, align, heap_mask, flags);
if (IS_ERR_OR_NULL(hndl)) {
dprintk(VIDC_ERR,
"Failed to allocate shared memory = %p, %d, %d, 0x%x\n",
client, size, align, flags);
rc = -ENOMEM;
goto fail_shared_mem_alloc;
}
mem->mem_type = client->mem_type;
mem->smem_priv = hndl;
mem->flags = flags;
mem->buffer_type = buffer_type;
if (map_kernel) {
mem->kvaddr = ion_map_kernel(client->clnt, hndl);
if (!mem->kvaddr) {
dprintk(VIDC_ERR,
"Failed to map shared mem in kernel\n");
rc = -EIO;
goto fail_map;
}
} else
mem->kvaddr = NULL;
rc = get_device_address(client, hndl, align, &iova, &buffer_size,
flags, buffer_type);
if (rc) {
dprintk(VIDC_ERR, "Failed to get device address: %d\n",
rc);
goto fail_device_address;
}
mem->device_addr = iova;
mem->size = size;
dprintk(VIDC_DBG,
"%s: ion_handle = 0x%p, device_addr = 0x%x, size = %d, kvaddr = 0x%p, buffer_type = %d\n",
__func__, mem->smem_priv, (u32)mem->device_addr,
mem->size, mem->kvaddr, mem->buffer_type);
return rc;
fail_device_address:
ion_unmap_kernel(client->clnt, hndl);
fail_map:
ion_free(client->clnt, hndl);
fail_shared_mem_alloc:
return rc;
}
static void free_ion_mem(struct smem_client *client, struct msm_smem *mem)
{
int domain, partition, rc;
dprintk(VIDC_DBG,
"%s: ion_handle = 0x%p, device_addr = 0x%x, size = %d, kvaddr = 0x%p, buffer_type = %d\n",
__func__, mem->smem_priv, (u32)mem->device_addr,
mem->size, mem->kvaddr, mem->buffer_type);
rc = msm_smem_get_domain_partition((void *)client, mem->flags,
mem->buffer_type, &domain, &partition);
if (rc) {
dprintk(VIDC_ERR, "Failed to get domain, partition: %d\n", rc);
return;
}
if (mem->device_addr)
put_device_address(client,
mem->smem_priv, domain, partition, mem->flags);
if (mem->kvaddr)
ion_unmap_kernel(client->clnt, mem->smem_priv);
if (mem->smem_priv)
ion_free(client->clnt, mem->smem_priv);
}
static void *ion_new_client(void)
{
struct ion_client *client = NULL;
client = msm_ion_client_create(-1, "video_client");
if (!client)
dprintk(VIDC_ERR, "Failed to create smem client\n");
return client;
};
static void ion_delete_client(struct smem_client *client)
{
ion_client_destroy(client->clnt);
}
struct msm_smem *msm_smem_user_to_kernel(void *clt, int fd, u32 offset,
enum hal_buffer buffer_type)
{
struct smem_client *client = clt;
int rc = 0;
struct msm_smem *mem;
if (fd < 0) {
dprintk(VIDC_ERR, "Invalid fd: %d\n", fd);
return NULL;
}
mem = kzalloc(sizeof(*mem), GFP_KERNEL);
if (!mem) {
dprintk(VIDC_ERR, "Failed to allocte shared mem\n");
return NULL;
}
switch (client->mem_type) {
case SMEM_ION:
rc = ion_user_to_kernel(clt, fd, offset, mem, buffer_type);
break;
default:
dprintk(VIDC_ERR, "Mem type not supported\n");
rc = -EINVAL;
break;
}
if (rc) {
dprintk(VIDC_ERR, "Failed to allocate shared memory\n");
kfree(mem);
mem = NULL;
}
return mem;
}
static int ion_cache_operations(struct smem_client *client,
struct msm_smem *mem, enum smem_cache_ops cache_op)
{
unsigned long ionflag = 0;
int rc = 0;
int msm_cache_ops = 0;
if (!mem || !client) {
dprintk(VIDC_ERR, "Invalid params: %p, %p\n",
mem, client);
return -EINVAL;
}
rc = ion_handle_get_flags(client->clnt, mem->smem_priv,
&ionflag);
if (rc) {
dprintk(VIDC_ERR,
"ion_handle_get_flags failed: %d\n", rc);
goto cache_op_failed;
}
if (ION_IS_CACHED(ionflag)) {
switch (cache_op) {
case SMEM_CACHE_CLEAN:
msm_cache_ops = ION_IOC_CLEAN_CACHES;
break;
case SMEM_CACHE_INVALIDATE:
msm_cache_ops = ION_IOC_INV_CACHES;
break;
case SMEM_CACHE_CLEAN_INVALIDATE:
msm_cache_ops = ION_IOC_CLEAN_INV_CACHES;
break;
default:
dprintk(VIDC_ERR, "cache operation not supported\n");
rc = -EINVAL;
goto cache_op_failed;
}
rc = msm_ion_do_cache_op(client->clnt,
(struct ion_handle *)mem->smem_priv,
0, (unsigned long)mem->size,
msm_cache_ops);
if (rc) {
dprintk(VIDC_ERR,
"cache operation failed %d\n", rc);
goto cache_op_failed;
}
}
cache_op_failed:
return rc;
}
int msm_smem_cache_operations(void *clt, struct msm_smem *mem,
enum smem_cache_ops cache_op)
{
struct smem_client *client = clt;
int rc = 0;
if (!client) {
dprintk(VIDC_ERR, "Invalid params: %p\n",
client);
return -EINVAL;
}
switch (client->mem_type) {
case SMEM_ION:
rc = ion_cache_operations(client, mem, cache_op);
if (rc)
dprintk(VIDC_ERR,
"Failed cache operations: %d\n", rc);
break;
default:
dprintk(VIDC_ERR, "Mem type not supported\n");
break;
}
return rc;
}
void *msm_smem_new_client(enum smem_type mtype,
void *platform_resources)
{
struct smem_client *client = NULL;
void *clnt = NULL;
struct msm_vidc_platform_resources *res = platform_resources;
switch (mtype) {
case SMEM_ION:
clnt = ion_new_client();
break;
default:
dprintk(VIDC_ERR, "Mem type not supported\n");
break;
}
if (clnt) {
client = kzalloc(sizeof(*client), GFP_KERNEL);
if (client) {
client->mem_type = mtype;
client->clnt = clnt;
client->res = res;
}
} else {
dprintk(VIDC_ERR, "Failed to create new client: mtype = %d\n",
mtype);
}
return client;
}
struct msm_smem *msm_smem_alloc(void *clt, size_t size, u32 align, u32 flags,
enum hal_buffer buffer_type, int map_kernel)
{
struct smem_client *client;
int rc = 0;
struct msm_smem *mem;
client = clt;
if (!client) {
dprintk(VIDC_ERR, "Invalid client passed\n");
return NULL;
}
if (!size) {
dprintk(VIDC_ERR, "No need to allocate memory of size: %d\n",
size);
return NULL;
}
mem = kzalloc(sizeof(*mem), GFP_KERNEL);
if (!mem) {
dprintk(VIDC_ERR, "Failed to allocate shared mem\n");
return NULL;
}
switch (client->mem_type) {
case SMEM_ION:
rc = alloc_ion_mem(client, size, align, flags, buffer_type,
mem, map_kernel);
break;
default:
dprintk(VIDC_ERR, "Mem type not supported\n");
rc = -EINVAL;
break;
}
if (rc) {
dprintk(VIDC_ERR, "Failed to allocate shared memory\n");
kfree(mem);
mem = NULL;
}
return mem;
}
void msm_smem_free(void *clt, struct msm_smem *mem)
{
struct smem_client *client = clt;
if (!client || !mem) {
dprintk(VIDC_ERR, "Invalid client/handle passed\n");
return;
}
switch (client->mem_type) {
case SMEM_ION:
free_ion_mem(client, mem);
break;
default:
dprintk(VIDC_ERR, "Mem type not supported\n");
break;
}
kfree(mem);
};
void msm_smem_delete_client(void *clt)
{
struct smem_client *client = clt;
if (!client) {
dprintk(VIDC_ERR, "Invalid client passed\n");
return;
}
switch (client->mem_type) {
case SMEM_ION:
ion_delete_client(client);
break;
default:
dprintk(VIDC_ERR, "Mem type not supported\n");
break;
}
kfree(client);
}
int msm_smem_get_domain_partition(void *clt, u32 flags, enum hal_buffer
buffer_type, int *domain_num, int *partition_num)
{
struct smem_client *client = clt;
struct iommu_set *iommu_group_set = &client->res->iommu_group_set;
int i;
int j;
bool is_secure = (flags & SMEM_SECURE);
struct iommu_info *iommu_map;
if (!domain_num || !partition_num) {
dprintk(VIDC_DBG, "passed null to get domain partition!\n");
return -EINVAL;
}
*domain_num = -1;
*partition_num = -1;
if (!iommu_group_set) {
dprintk(VIDC_DBG, "no iommu group set present!\n");
return -ENOENT;
}
for (i = 0; i < iommu_group_set->count; i++) {
iommu_map = &iommu_group_set->iommu_maps[i];
if (iommu_map->is_secure == is_secure) {
for (j = 0; j < iommu_map->npartitions; j++) {
if (iommu_map->buffer_type[j] & buffer_type) {
*domain_num = iommu_map->domain;
*partition_num = j;
break;
}
}
}
}
dprintk(VIDC_DBG, "domain: %d, partition: %d found!\n",
*domain_num, *partition_num);
return 0;
}
| {
"content_hash": "7dd14e8e575baff9eb81227ef6948c1e",
"timestamp": "",
"source": "github",
"line_count": 534,
"max_line_length": 101,
"avg_line_length": 24.60112359550562,
"alnum_prop": 0.6496155895562152,
"repo_name": "Ant-OS/android_kernel_moto_shamu",
"id": "f4eb59b267a8dfc2ceb3cc6a717a00cc6449842a",
"size": "13672",
"binary": false,
"copies": "234",
"ref": "refs/heads/master",
"path": "drivers/media/platform/msm/vidc/msm_smem.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "4528"
},
{
"name": "Assembly",
"bytes": "9738337"
},
{
"name": "Awk",
"bytes": "18681"
},
{
"name": "C",
"bytes": "467488098"
},
{
"name": "C++",
"bytes": "3473858"
},
{
"name": "Clojure",
"bytes": "547"
},
{
"name": "Groff",
"bytes": "22012"
},
{
"name": "Lex",
"bytes": "40805"
},
{
"name": "Makefile",
"bytes": "1342678"
},
{
"name": "Objective-C",
"bytes": "1121986"
},
{
"name": "Perl",
"bytes": "461504"
},
{
"name": "Python",
"bytes": "33978"
},
{
"name": "Scilab",
"bytes": "21433"
},
{
"name": "Shell",
"bytes": "138789"
},
{
"name": "SourcePawn",
"bytes": "4687"
},
{
"name": "UnrealScript",
"bytes": "6113"
},
{
"name": "Yacc",
"bytes": "83091"
}
],
"symlink_target": ""
} |
Template.post.onCreated(function() {
this.searchQuery = new ReactiveVar('');
this.filter = new ReactiveVar('all');
this.limit = new ReactiveVar(20);
this.autorun(() => {
this.subscribe('posts.all', this.searchQuery.get(), this.filter.get(), this.limit.get());
});
});
Template.post.events({
'click [data-id=remove-post]': function(event, template) {
let self = this;
// Sweet Alert delete confirmation
swal({
title: 'Delete post?',
text: 'Are you sure that you want to delete this post?',
type: 'error',
showCancelButton: true,
closeOnConfirm: true,
cancelButtonText: 'No',
confirmButtonText: 'Yes, delete it!',
confirmButtonColor: '#da5347'
}, function() {
Meteor.call('posts.remove', self._id, (error, result) => {
if (error) {
Bert.alert(error.reason, 'danger', 'growl-top-right');
} else {
Bert.alert('Post successfully removed', 'success', 'growl-top-right');
}
});
});
},
'click [data-id=like-post]': function(event, template) {
let self = this;
Meteor.call('posts.like', self._id, (error, result) => {
if (error) {
Bert.alert(error.reason, 'danger', 'growl-top-right');
}
});
}
});
Template.post.helpers({
author: function() {
return Meteor.users.findOne({ _id: this.authorId });
},
belongsPostToUser: function() {
return this.authorId === Meteor.userId();
},
formatDate: function(date) {
let currDate = moment(new Date()),
msgDate = moment(new Date(date));
let diff = currDate.diff(msgDate, 'days');
if (diff === 0 && currDate.day() === msgDate.day()) {
let hourDiff = currDate.diff(msgDate, 'hours'),
minDiff = currDate.diff(msgDate, 'minutes');
if (hourDiff > 0) {
if (hourDiff === 1) {
return (hourDiff + ' hr');
} else {
return (hourDiff + ' hrs');
}
} else if (minDiff > 0) {
if (minDiff === 1) {
return (minDiff + ' min');
} else {
return (minDiff + ' mins');
}
} else {
return 'Just now';
}
} else if (diff <= 1 && currDate.day() !== msgDate.day()) {
return ('Yesterday at ' + moment(date).format('h:mm a'));
} else {
if (currDate.year() !== msgDate.year()) {
return moment(date).format('MMMM DD, YYYY');
} else {
return (moment(date).format('MMMM DD') + ' at ' + moment(date).format('h:mm a'));
}
}
},
isLiked: function() {
if (Posts.find( { _id: this._id, already_voted: { $in: [Meteor.userId()]} }).count() === 1) {
return 'liked';
}
return '';
}
});
| {
"content_hash": "642b1ff95359354fc07b3619e7b326ae",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 97,
"avg_line_length": 29.380434782608695,
"alnum_prop": 0.5431002589715132,
"repo_name": "mattvella07/gravity",
"id": "fd42865728787390b59b426c32a2a7126e72131a",
"size": "2703",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "client/views/shared/_post.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "372"
},
{
"name": "HTML",
"bytes": "18198"
},
{
"name": "JavaScript",
"bytes": "64601"
}
],
"symlink_target": ""
} |
var express = require('express');
var router = express.Router();
var Event = require('../models/event');
//events routes will go here
module.exports = router; | {
"content_hash": "663676a8108a95a937d894f2419113f1",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 39,
"avg_line_length": 20.125,
"alnum_prop": 0.7018633540372671,
"repo_name": "ma3east/eStub2",
"id": "1a1d7de91da0a69fdc98a682a96f1968cea84c33",
"size": "161",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/controllers/events.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "395"
},
{
"name": "JavaScript",
"bytes": "4743"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>DocStrap Module: mixins/signalable</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.superhero.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">DocStrap</a>
</div>
<div class="navbar-collapse">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="module-base.html">base</a></li><li><a href="module-base_chains.html">base/chains</a></li><li><a href="module-documents_binder.html">documents/binder</a></li><li><a href="module-documents_model.html">documents/model</a></li><li><a href="module-documents_probe.html">documents/probe</a></li><li><a href="module-documents_schema.html">documents/schema</a></li><li><a href="module-ink_collector.html">ink/collector</a></li><li><a href="module-mixins_bussable.html">mixins/bussable</a></li><li><a href="module-mixins_signalable.html">mixins/signalable</a></li><li><a href="module-strings_format.html">strings/format</a></li><li><a href="module-utils_logger.html">utils/logger</a></li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="base.html">base</a></li><li><a href="base_chains.html">base/chains</a></li><li><a href="documents_model.html">documents/model</a></li><li><a href="module-documents_probe.This%252520is%252520not%252520actually%252520a%252520class,%252520but%252520an%252520artifact%252520of%252520the%252520documentation%252520system.html">documents/probe.This is not actually a class, but an artifact of the documentation system</a></li><li><a href="module-ink_collector-ACollector.html">ink/collector~ACollector</a></li><li><a href="module-ink_collector-CollectorBase.html">ink/collector~CollectorBase</a></li><li><a href="module-ink_collector-OCollector.html">ink/collector~OCollector</a></li><li><a href="module-mixins_signalable-Signal.html">mixins/signalable~Signal</a></li><li><a href="utils_logger.Logger.html">utils/logger.Logger</a></li>
</ul>
</li>
<li class="dropdown">
<a href="mixins.list.html" class="dropdown-toggle" data-toggle="dropdown">Mixins<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="documents_schema.html">documents/schema</a></li><li><a href="mixins_bussable.html">mixins/bussable</a></li><li><a href="mixins_signalable.html">mixins/signalable</a></li>
</ul>
</li>
<li class="dropdown">
<a href="tutorials.list.html" class="dropdown-toggle" data-toggle="dropdown">Tutorials<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="tutorial-Brush Teeth.html">Brush Teeth</a></li><li><a href="tutorial-Drive Car.html">Drive Car</a></li><li><a href="tutorial-Fence Test.html">Fence Test</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-8">
<div id="main">
<h1 class="page-title">Module: mixins/signalable</h1>
<h1 class="page-title">Module: mixins/signalable</h1>
<section>
<header>
</header>
<article>
<div class="container-overview">
<div class="description"><p>Add the ability to fire signals on your objects. Signals are events, but hard coded into the object
and don't rely on strings like other events and <code>eventables</code></p></div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="mixins_signalable.js.html">mixins/signalable.js</a>,
<a href="mixins_signalable.js.html#sunlight-1-line-2">line 2</a>
</li>
</ul>
</dd>
</dl>
</div>
<h3 class="subsection-title">Requires</h3>
<ul>
<li><a href="module-base.html">module:base</a></li>
<li>module:signals</li>
<li>module:base/logger</li>
</ul>
<h3 class="subsection-title">Classes</h3>
<dl>
<dt><a href="module-mixins_signalable-Signal.html">Signal</a></dt>
<dd></dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<dl>
<dt class="name" id=".SignalOptions">
<h4>SignalOptions</h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>memorize</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>If Signal should keep record of previously dispatched parameters and automatically execute listener. Defaults to <code>false</code></p></td>
</tr>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">array</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>Default parameters passed to listener during <code>Signal.raise</code>/<code>Signal.fire</code>/<code>Signal.trigger</code> and SignalBinding.execute. (curried parameters). Defaults to <code>null</code></p></td>
</tr>
<tr>
<td class="name"><code>context</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>When provided the signal will be raised in the context of this object. Defaults to <code>this</code> - the signal host</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="mixins_signalable.js.html">mixins/signalable.js</a>,
<a href="mixins_signalable.js.html#sunlight-1-line-16">line 16</a>
</li>
</ul>
</dd>
</dl>
<h5>Example</h5>
<pre class="sunlight-highlight-javascript">signals:{
opened: null,
twisted: { memorize:true },
applied: { memorize: false, params:[one, two] }
}
// Setting the context initially can be a hassle, so this also supports a function that returns a hash
signals: function(){
return {
opened: null,
twisted: { memorize:true },
applied: { memorize: false, params:[one, two] },
reversed: {context: someOtherRuntimeObject}
};
}</pre>
</dd>
</dl>
</article>
</section>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-3">
<div id="toc" class="col-md-3"></div>
</div>
</div>
</div>
<footer>
<span class="copyright">
DocStrap Copyright © 2012-2013 The contributors to the JSDoc3 and DocStrap projects.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-beta1</a>
on Thu Feb 5th 2015 using the <a
href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
<!--<script src="scripts/sunlight.js"></script>-->
<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script>
$( function () {
$( "[id*='$']" ).each( function () {
var $this = $( this );
$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
} );
$( "#toc" ).toc( {
anchorName : function ( i, heading, prefix ) {
return $( heading ).attr( "id" ) || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : "100px"
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
$( '.dropdown-toggle' ).dropdown();
// $( ".tutorial-section pre, .readme-section pre" ).addClass( "sunlight-highlight-javascript" ).addClass( "linenums" );
$( ".tutorial-section pre, .readme-section pre" ).each( function () {
var $this = $( this );
var example = $this.find( "code" );
exampleText = example.html();
var lang = /{@lang (.*?)}/.exec( exampleText );
if ( lang && lang[1] ) {
exampleText = exampleText.replace( lang[0], "" );
example.html( exampleText );
lang = lang[1];
} else {
lang = "javascript";
}
if ( lang ) {
$this
.addClass( "sunlight-highlight-" + lang )
.addClass( "linenums" )
.html( example.html() );
}
} );
Sunlight.highlightAll( {
lineNumbers : true,
showMenu : true,
enableDoclinks : true
} );
} );
</script>
<!--Navigation and Symbol Display-->
<!--Google Analytics-->
</body>
</html> | {
"content_hash": "e51ee4a072621c79ad83235332839541",
"timestamp": "",
"source": "github",
"line_count": 494,
"max_line_length": 847,
"avg_line_length": 21.25506072874494,
"alnum_prop": 0.5472380952380952,
"repo_name": "labertasch/awesome",
"id": "c50eb36869d650551a97a0ae881eede611945304",
"size": "10501",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "stream/node_modules/grunt-jsdoc/node_modules/ink-docstrap/themes/superhero/module-mixins_signalable.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2579331"
},
{
"name": "HTML",
"bytes": "172677"
},
{
"name": "Java",
"bytes": "26469"
},
{
"name": "JavaScript",
"bytes": "2286722"
},
{
"name": "TypeScript",
"bytes": "1118"
}
],
"symlink_target": ""
} |
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:v="urn:import:com.christophdietze.jack.client.view"
xmlns:ve="urn:import:com.christophdietze.jack.client.view.embed">
<ui:style>
.boardPanel {
float: left;
}
.rightPanel {
float: left;
margin-left: 1em;
margin-top: 0.5em;
}
.playerNamePanel {
margin-bottom: 1.5em;
}
</ui:style>
<g:FlowPanel>
<v:BoardPanel styleName="{style.boardPanel}" />
<g:FlowPanel styleName="{style.rightPanel}">
<v:PlayerNamePanel styleName="{style.playerNamePanel}" />
<ve:MoveNavigationPanel />
<ve:MoveTextPanel />
</g:FlowPanel>
</g:FlowPanel>
</ui:UiBinder>
| {
"content_hash": "14d0e7b4211b05d358e8818ca24e6e8c",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 109,
"avg_line_length": 25.06451612903226,
"alnum_prop": 0.6846846846846847,
"repo_name": "cdietze/chessdog",
"id": "e911af07fb7c9513f16500522d661cc9e24d8291",
"size": "777",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/christophdietze/jack/client/view/embed/MainPanelEmbed.ui.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "3392"
},
{
"name": "Java",
"bytes": "167134"
},
{
"name": "JavaScript",
"bytes": "2764"
},
{
"name": "Scala",
"bytes": "672"
}
],
"symlink_target": ""
} |
<?php
namespace DDiff\Database\Schema;
/**
* Class TableAwareTrait
* @package DDiff\Database\Schema
*/
class TableAwareTrait
{
/**
* @var TableInterface
*/
private $table;
/**
* @return TableInterface
*/
public function getTable() : TableInterface
{
return $this->table;
}
/**
* @param TableInterface $table
* @return $this
*/
public function setTable(TableInterface $table)
{
$this->table = $table;
return $this;
}
}
| {
"content_hash": "0018fe8b9a22e879f5c7a4622fe18b67",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 51,
"avg_line_length": 15.441176470588236,
"alnum_prop": 0.5638095238095238,
"repo_name": "oncesk/ddiff",
"id": "7960c40223f3a76a1372fcd04450159b51b5696b",
"size": "525",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Database/Schema/TableAwareTrait.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "135859"
}
],
"symlink_target": ""
} |
package org.docksidestage.compatible10x.dbflute.bsentity;
import java.util.List;
import java.util.ArrayList;
import org.dbflute.dbmeta.DBMeta;
import org.dbflute.dbmeta.AbstractEntity;
import org.dbflute.dbmeta.accessory.DomainEntity;
import org.docksidestage.compatible10x.dbflute.allcommon.DBMetaInstanceHandler;
import org.docksidestage.compatible10x.dbflute.exentity.*;
/**
* The entity of VENDOR_THE_LONG_AND_WINDING_TABLE_AND_COLUMN as TABLE. <br>
* <pre>
* [primary-key]
* THE_LONG_AND_WINDING_TABLE_AND_COLUMN_ID
*
* [column]
* THE_LONG_AND_WINDING_TABLE_AND_COLUMN_ID, THE_LONG_AND_WINDING_TABLE_AND_COLUMN_NAME, SHORT_NAME, SHORT_SIZE
*
* [sequence]
*
*
* [identity]
*
*
* [version-no]
*
*
* [foreign table]
*
*
* [referrer table]
* VENDOR_THE_LONG_AND_WINDING_TABLE_AND_COLUMN_REF
*
* [foreign property]
*
*
* [referrer property]
* vendorTheLongAndWindingTableAndColumnRefList
*
* [get/set template]
* /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Long theLongAndWindingTableAndColumnId = entity.getTheLongAndWindingTableAndColumnId();
* String theLongAndWindingTableAndColumnName = entity.getTheLongAndWindingTableAndColumnName();
* String shortName = entity.getShortName();
* Integer shortSize = entity.getShortSize();
* entity.setTheLongAndWindingTableAndColumnId(theLongAndWindingTableAndColumnId);
* entity.setTheLongAndWindingTableAndColumnName(theLongAndWindingTableAndColumnName);
* entity.setShortName(shortName);
* entity.setShortSize(shortSize);
* = = = = = = = = = =/
* </pre>
* @author DBFlute(AutoGenerator)
*/
public abstract class BsVendorTheLongAndWindingTableAndColumn extends AbstractEntity implements DomainEntity {
// ===================================================================================
// Definition
// ==========
/** The serial version UID for object serialization. (Default) */
private static final long serialVersionUID = 1L;
// ===================================================================================
// Attribute
// =========
/** THE_LONG_AND_WINDING_TABLE_AND_COLUMN_ID: {PK, NotNull, BIGINT(19)} */
protected Long _theLongAndWindingTableAndColumnId;
/** THE_LONG_AND_WINDING_TABLE_AND_COLUMN_NAME: {UQ, NotNull, VARCHAR(200)} */
protected String _theLongAndWindingTableAndColumnName;
/** SHORT_NAME: {NotNull, VARCHAR(200)} */
protected String _shortName;
/** SHORT_SIZE: {NotNull, INTEGER(10)} */
protected Integer _shortSize;
// ===================================================================================
// DB Meta
// =======
/** {@inheritDoc} */
public DBMeta asDBMeta() {
return DBMetaInstanceHandler.findDBMeta(asTableDbName());
}
/** {@inheritDoc} */
public String asTableDbName() {
return "VENDOR_THE_LONG_AND_WINDING_TABLE_AND_COLUMN";
}
// ===================================================================================
// Key Handling
// ============
/** {@inheritDoc} */
public boolean hasPrimaryKeyValue() {
if (_theLongAndWindingTableAndColumnId == null) { return false; }
return true;
}
/**
* To be unique by the unique column. <br>
* You can update the entity by the key when entity update (NOT batch update).
* @param theLongAndWindingTableAndColumnName : UQ, NotNull, VARCHAR(200). (NotNull)
*/
public void uniqueBy(String theLongAndWindingTableAndColumnName) {
__uniqueDrivenProperties.clear();
__uniqueDrivenProperties.addPropertyName("theLongAndWindingTableAndColumnName");
setTheLongAndWindingTableAndColumnName(theLongAndWindingTableAndColumnName);
}
// ===================================================================================
// Foreign Property
// ================
// ===================================================================================
// Referrer Property
// =================
/** VENDOR_THE_LONG_AND_WINDING_TABLE_AND_COLUMN_REF by THE_LONG_AND_WINDING_TABLE_AND_COLUMN_ID, named 'vendorTheLongAndWindingTableAndColumnRefList'. */
protected List<VendorTheLongAndWindingTableAndColumnRef> _vendorTheLongAndWindingTableAndColumnRefList;
/**
* [get] VENDOR_THE_LONG_AND_WINDING_TABLE_AND_COLUMN_REF by THE_LONG_AND_WINDING_TABLE_AND_COLUMN_ID, named 'vendorTheLongAndWindingTableAndColumnRefList'.
* @return The entity list of referrer property 'vendorTheLongAndWindingTableAndColumnRefList'. (NotNull: even if no loading, returns empty list)
*/
public List<VendorTheLongAndWindingTableAndColumnRef> getVendorTheLongAndWindingTableAndColumnRefList() {
if (_vendorTheLongAndWindingTableAndColumnRefList == null) { _vendorTheLongAndWindingTableAndColumnRefList = newReferrerList(); }
return _vendorTheLongAndWindingTableAndColumnRefList;
}
/**
* [set] VENDOR_THE_LONG_AND_WINDING_TABLE_AND_COLUMN_REF by THE_LONG_AND_WINDING_TABLE_AND_COLUMN_ID, named 'vendorTheLongAndWindingTableAndColumnRefList'.
* @param vendorTheLongAndWindingTableAndColumnRefList The entity list of referrer property 'vendorTheLongAndWindingTableAndColumnRefList'. (NullAllowed)
*/
public void setVendorTheLongAndWindingTableAndColumnRefList(List<VendorTheLongAndWindingTableAndColumnRef> vendorTheLongAndWindingTableAndColumnRefList) {
_vendorTheLongAndWindingTableAndColumnRefList = vendorTheLongAndWindingTableAndColumnRefList;
}
protected <ELEMENT> List<ELEMENT> newReferrerList() { // overriding to import
return new ArrayList<ELEMENT>();
}
// ===================================================================================
// Basic Override
// ==============
@Override
protected boolean doEquals(Object obj) {
if (obj instanceof BsVendorTheLongAndWindingTableAndColumn) {
BsVendorTheLongAndWindingTableAndColumn other = (BsVendorTheLongAndWindingTableAndColumn)obj;
if (!xSV(_theLongAndWindingTableAndColumnId, other._theLongAndWindingTableAndColumnId)) { return false; }
return true;
} else {
return false;
}
}
@Override
protected int doHashCode(int initial) {
int hs = initial;
hs = xCH(hs, asTableDbName());
hs = xCH(hs, _theLongAndWindingTableAndColumnId);
return hs;
}
@Override
protected String doBuildStringWithRelation(String li) {
StringBuilder sb = new StringBuilder();
if (_vendorTheLongAndWindingTableAndColumnRefList != null) { for (VendorTheLongAndWindingTableAndColumnRef et : _vendorTheLongAndWindingTableAndColumnRefList)
{ if (et != null) { sb.append(li).append(xbRDS(et, "vendorTheLongAndWindingTableAndColumnRefList")); } } }
return sb.toString();
}
@Override
protected String doBuildColumnString(String dm) {
StringBuilder sb = new StringBuilder();
sb.append(dm).append(xfND(_theLongAndWindingTableAndColumnId));
sb.append(dm).append(xfND(_theLongAndWindingTableAndColumnName));
sb.append(dm).append(xfND(_shortName));
sb.append(dm).append(xfND(_shortSize));
if (sb.length() > dm.length()) {
sb.delete(0, dm.length());
}
sb.insert(0, "{").append("}");
return sb.toString();
}
@Override
protected String doBuildRelationString(String dm) {
StringBuilder sb = new StringBuilder();
if (_vendorTheLongAndWindingTableAndColumnRefList != null && !_vendorTheLongAndWindingTableAndColumnRefList.isEmpty())
{ sb.append(dm).append("vendorTheLongAndWindingTableAndColumnRefList"); }
if (sb.length() > dm.length()) {
sb.delete(0, dm.length()).insert(0, "(").append(")");
}
return sb.toString();
}
@Override
public VendorTheLongAndWindingTableAndColumn clone() {
return (VendorTheLongAndWindingTableAndColumn)super.clone();
}
// ===================================================================================
// Accessor
// ========
/**
* [get] THE_LONG_AND_WINDING_TABLE_AND_COLUMN_ID: {PK, NotNull, BIGINT(19)} <br>
* @return The value of the column 'THE_LONG_AND_WINDING_TABLE_AND_COLUMN_ID'. (basically NotNull if selected: for the constraint)
*/
public Long getTheLongAndWindingTableAndColumnId() {
checkSpecifiedProperty("theLongAndWindingTableAndColumnId");
return _theLongAndWindingTableAndColumnId;
}
/**
* [set] THE_LONG_AND_WINDING_TABLE_AND_COLUMN_ID: {PK, NotNull, BIGINT(19)} <br>
* @param theLongAndWindingTableAndColumnId The value of the column 'THE_LONG_AND_WINDING_TABLE_AND_COLUMN_ID'. (basically NotNull if update: for the constraint)
*/
public void setTheLongAndWindingTableAndColumnId(Long theLongAndWindingTableAndColumnId) {
registerModifiedProperty("theLongAndWindingTableAndColumnId");
_theLongAndWindingTableAndColumnId = theLongAndWindingTableAndColumnId;
}
/**
* [get] THE_LONG_AND_WINDING_TABLE_AND_COLUMN_NAME: {UQ, NotNull, VARCHAR(200)} <br>
* @return The value of the column 'THE_LONG_AND_WINDING_TABLE_AND_COLUMN_NAME'. (basically NotNull if selected: for the constraint)
*/
public String getTheLongAndWindingTableAndColumnName() {
checkSpecifiedProperty("theLongAndWindingTableAndColumnName");
return _theLongAndWindingTableAndColumnName;
}
/**
* [set] THE_LONG_AND_WINDING_TABLE_AND_COLUMN_NAME: {UQ, NotNull, VARCHAR(200)} <br>
* @param theLongAndWindingTableAndColumnName The value of the column 'THE_LONG_AND_WINDING_TABLE_AND_COLUMN_NAME'. (basically NotNull if update: for the constraint)
*/
public void setTheLongAndWindingTableAndColumnName(String theLongAndWindingTableAndColumnName) {
registerModifiedProperty("theLongAndWindingTableAndColumnName");
_theLongAndWindingTableAndColumnName = theLongAndWindingTableAndColumnName;
}
/**
* [get] SHORT_NAME: {NotNull, VARCHAR(200)} <br>
* @return The value of the column 'SHORT_NAME'. (basically NotNull if selected: for the constraint)
*/
public String getShortName() {
checkSpecifiedProperty("shortName");
return _shortName;
}
/**
* [set] SHORT_NAME: {NotNull, VARCHAR(200)} <br>
* @param shortName The value of the column 'SHORT_NAME'. (basically NotNull if update: for the constraint)
*/
public void setShortName(String shortName) {
registerModifiedProperty("shortName");
_shortName = shortName;
}
/**
* [get] SHORT_SIZE: {NotNull, INTEGER(10)} <br>
* @return The value of the column 'SHORT_SIZE'. (basically NotNull if selected: for the constraint)
*/
public Integer getShortSize() {
checkSpecifiedProperty("shortSize");
return _shortSize;
}
/**
* [set] SHORT_SIZE: {NotNull, INTEGER(10)} <br>
* @param shortSize The value of the column 'SHORT_SIZE'. (basically NotNull if update: for the constraint)
*/
public void setShortSize(Integer shortSize) {
registerModifiedProperty("shortSize");
_shortSize = shortSize;
}
}
| {
"content_hash": "70244c618a98503b6d307d9e3a5708d2",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 169,
"avg_line_length": 45.101083032490976,
"alnum_prop": 0.5850476266709357,
"repo_name": "dbflute-test/dbflute-test-option-compatible10x",
"id": "c17809534e70328b4ada1c74fe8604043707aa89",
"size": "13112",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/docksidestage/compatible10x/dbflute/bsentity/BsVendorTheLongAndWindingTableAndColumn.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "42349"
},
{
"name": "HTML",
"bytes": "42250"
},
{
"name": "Java",
"bytes": "8310649"
},
{
"name": "PLpgSQL",
"bytes": "848"
},
{
"name": "Perl",
"bytes": "9821"
},
{
"name": "Python",
"bytes": "3285"
},
{
"name": "Roff",
"bytes": "105"
},
{
"name": "Shell",
"bytes": "28618"
},
{
"name": "XSLT",
"bytes": "218435"
}
],
"symlink_target": ""
} |
package com.afg.MngProductContentProvider.interfaces;
import android.content.Context;
/**
* Created by usuario on 10/11/16.
*/
public interface IPreferences {
public static final int MODE = Context.MODE_PRIVATE;
//static IPreferences getInstance(Context context){};
}
| {
"content_hash": "cee406d8b5b3304c7e88a65e3b84be2f",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 57,
"avg_line_length": 20.214285714285715,
"alnum_prop": 0.7455830388692579,
"repo_name": "JMedinilla/deint_ManageProducts",
"id": "d283763a9aae2a008bd87ff94c7168e332157035",
"size": "935",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "MngProvider_v2/app/src/main/java/com/afg/MngProductContentProvider/interfaces/IPreferences.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "38526"
},
{
"name": "HTML",
"bytes": "11858050"
},
{
"name": "Java",
"bytes": "1191610"
},
{
"name": "JavaScript",
"bytes": "2481"
}
],
"symlink_target": ""
} |
{% extends "wiki/base.html" %}
{% load i18n wiki_tags sekizai_tags %}
{% block wiki_pagetitle %}{% trans "Admin Panel" %}{% endblock %}
{% block wiki_contents %}
<h1 class="page-header">{% trans "Deleted Articles" %}</h1>
{% if deleted_articles %}
<table class="table table-striped">
<thead>
<tr>
<th>{% trans "Page Title" %}</th>
<th>{% trans "Date Deleted" %}</th>
<th>{% trans "Restore Article" %}</th>
</tr>
</thead>
<tbody>
{% for article in deleted_articles %}
<tr>
<td><a href="{{article.get_absolute_url}}">{{ article }}</a></td>
<td> {{article.modified}} </td>
<td><a href="{% url 'wiki:deleted' article_id=article.id %}?restore=1" class="btn btn-default"><span class="fa fa-repeat"></span>
{% trans "Restore" %}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<b> {% trans "No deleted articles to display" %} </b>
{% endif %}
{% endblock %}
| {
"content_hash": "663784fec8179b68a24035e4f374ea60",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 137,
"avg_line_length": 29.636363636363637,
"alnum_prop": 0.5357873210633947,
"repo_name": "skbly7/serc",
"id": "d0d72824a84d2688fe2517cdf86c7b8a8eaf2d45",
"size": "978",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "website/wiki/templates/wiki/deleted_list.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "167250"
},
{
"name": "GCC Machine Description",
"bytes": "107"
},
{
"name": "HTML",
"bytes": "127197"
},
{
"name": "JavaScript",
"bytes": "276437"
},
{
"name": "Python",
"bytes": "659443"
},
{
"name": "Shell",
"bytes": "194"
}
],
"symlink_target": ""
} |
<?php
namespace CoreTest\Presenter;
use Core\Presenter\MastheadPresenter;
class MastheadControllerTest extends \Dvsa\Mot\Frontend\Test\TestCase
{
protected $presenter;
protected $expectedUrl = 'http://www.smartsurvey.co.uk/s/MTSFeedback/';
protected function setUp()
{
$this->presenter = new MastheadPresenter();
}
protected function tearDown()
{
unset($this->presenter);
}
public function testGetFeedbackUrl()
{
$this->assertEquals($this->presenter->getFeedbackUrl(), $this->expectedUrl);
}
}
| {
"content_hash": "eaa1528bf70a2870aa5f6e63b6c6ef35",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 84,
"avg_line_length": 21.074074074074073,
"alnum_prop": 0.6731107205623902,
"repo_name": "dvsa/mot",
"id": "9f637a9e7da214a8ec263807fb5c6e9c5ed22b40",
"size": "569",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "mot-web-frontend/module/Core/test/CoreTest/Presenter/MastheadControllerTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "604618"
},
{
"name": "Dockerfile",
"bytes": "2693"
},
{
"name": "Gherkin",
"bytes": "189981"
},
{
"name": "HTML",
"bytes": "1579702"
},
{
"name": "Java",
"bytes": "1631717"
},
{
"name": "JavaScript",
"bytes": "156823"
},
{
"name": "Makefile",
"bytes": "2877"
},
{
"name": "PHP",
"bytes": "20142004"
},
{
"name": "PLpgSQL",
"bytes": "61098"
},
{
"name": "Python",
"bytes": "3354"
},
{
"name": "Ruby",
"bytes": "72"
},
{
"name": "SQLPL",
"bytes": "1739266"
},
{
"name": "Shell",
"bytes": "203709"
}
],
"symlink_target": ""
} |
package org.apache.asterix.dataflow.data.nontagged.serde;
import java.io.DataInput;
import java.io.DataOutput;
import java.util.ArrayList;
import java.util.List;
import org.apache.asterix.builders.OrderedListBuilder;
import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
import org.apache.asterix.om.base.AOrderedList;
import org.apache.asterix.om.base.IAObject;
import org.apache.asterix.om.types.AOrderedListType;
import org.apache.asterix.om.types.ATypeTag;
import org.apache.asterix.om.types.BuiltinType;
import org.apache.asterix.om.types.EnumDeserializer;
import org.apache.asterix.om.types.IAType;
import org.apache.asterix.om.types.TypeTagUtil;
import org.apache.asterix.om.util.NonTaggedFormatUtil;
import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
public class AOrderedListSerializerDeserializer implements ISerializerDeserializer<AOrderedList> {
private static final long serialVersionUID = 1L;
public static final AOrderedListSerializerDeserializer SCHEMALESS_INSTANCE = new AOrderedListSerializerDeserializer();
private final IAType itemType;
@SuppressWarnings("rawtypes")
private final ISerializerDeserializer serializer;
@SuppressWarnings("rawtypes")
private final ISerializerDeserializer deserializer;
private final AOrderedListType orderedlistType;
private AOrderedListSerializerDeserializer() {
this(new AOrderedListType(BuiltinType.ANY, "orderedlist"));
}
public AOrderedListSerializerDeserializer(AOrderedListType orderedlistType) {
this.orderedlistType = orderedlistType;
this.itemType = orderedlistType.getItemType();
serializer = AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(itemType);
deserializer = itemType.getTypeTag() == ATypeTag.ANY
? AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(itemType)
: AqlSerializerDeserializerProvider.INSTANCE.getNonTaggedSerializerDeserializer(itemType);
}
@Override
public AOrderedList deserialize(DataInput in) throws HyracksDataException {
try {
ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(in.readByte());
IAType currentItemType = itemType;
@SuppressWarnings("rawtypes")
ISerializerDeserializer currentDeserializer = deserializer;
if (itemType.getTypeTag() == ATypeTag.ANY && typeTag != ATypeTag.ANY) {
currentItemType = TypeTagUtil.getBuiltinTypeByTag(typeTag);
currentDeserializer = AqlSerializerDeserializerProvider.INSTANCE
.getNonTaggedSerializerDeserializer(currentItemType);
}
List<IAObject> items = new ArrayList<IAObject>();
in.readInt(); // list size
int numberOfitems;
numberOfitems = in.readInt();
if (numberOfitems > 0) {
if (!NonTaggedFormatUtil.isFixedSizedCollection(currentItemType)) {
for (int i = 0; i < numberOfitems; i++)
in.readInt();
}
for (int i = 0; i < numberOfitems; i++) {
IAObject v = (IAObject) currentDeserializer.deserialize(in);
items.add(v);
}
}
AOrderedListType type = new AOrderedListType(currentItemType, "orderedlist");
return new AOrderedList(type, items);
} catch (Exception e) {
throw new HyracksDataException(e);
}
}
@SuppressWarnings("unchecked")
@Override
public void serialize(AOrderedList instance, DataOutput out) throws HyracksDataException {
// TODO: schemaless ordered list serializer
OrderedListBuilder listBuilder = new OrderedListBuilder();
listBuilder.reset(orderedlistType);
ArrayBackedValueStorage itemValue = new ArrayBackedValueStorage();
for (int i = 0; i < instance.size(); i++) {
itemValue.reset();
serializer.serialize(instance.getItem(i), itemValue.getDataOutput());
listBuilder.addItem(itemValue);
}
listBuilder.write(out, false);
}
public static final int getOrderedListLength(byte[] serOrderedList, int offset) {
return AInt32SerializerDeserializer.getInt(serOrderedList, offset + 1);
}
public static int getNumberOfItems(byte[] serOrderedList, int offset) {
if (serOrderedList[offset] == ATypeTag.ORDEREDLIST.serialize())
// 6 = tag (1) + itemTag (1) + list size (4)
return AInt32SerializerDeserializer.getInt(serOrderedList, offset + 6);
else
return -1;
}
public static int getItemOffset(byte[] serOrderedList, int offset, int itemIndex) throws AsterixException {
if (serOrderedList[offset] == ATypeTag.ORDEREDLIST.serialize()) {
ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serOrderedList[offset + 1]);
if (NonTaggedFormatUtil.isFixedSizedCollection(typeTag)) {
int length = NonTaggedFormatUtil.getFieldValueLength(serOrderedList, offset + 1, typeTag, true);
return offset + 10 + (length * itemIndex);
} else {
return offset + AInt32SerializerDeserializer.getInt(serOrderedList, offset + 10 + (4 * itemIndex));
}
// 10 = tag (1) + itemTag (1) + list size (4) + number of items (4)
} else
return -1;
}
}
| {
"content_hash": "09bb19cd94c74f33d7e77dc8389ec5c4",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 122,
"avg_line_length": 45.6031746031746,
"alnum_prop": 0.6883049077619213,
"repo_name": "kisskys/incubator-asterixdb",
"id": "364b2d68c48c3b6b0344dda5e6c9c5e29bb0391e",
"size": "6553",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "8721"
},
{
"name": "C",
"bytes": "421"
},
{
"name": "CSS",
"bytes": "5656"
},
{
"name": "Crystal",
"bytes": "453"
},
{
"name": "Gnuplot",
"bytes": "89"
},
{
"name": "HTML",
"bytes": "124160"
},
{
"name": "Java",
"bytes": "18883430"
},
{
"name": "JavaScript",
"bytes": "262475"
},
{
"name": "Python",
"bytes": "281315"
},
{
"name": "Ruby",
"bytes": "3078"
},
{
"name": "Scheme",
"bytes": "1105"
},
{
"name": "Shell",
"bytes": "203955"
},
{
"name": "Smarty",
"bytes": "31412"
}
],
"symlink_target": ""
} |
package com.test.demo.myapp.activity;
import android.os.Bundle;
import android.provider.Settings;
import android.provider.Settings.Secure;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import com.test.demo.myapp.R;
public class ConstraintLayoutTesting extends AppCompatActivity {
private String uniqueString;
private TextView uniqueStringTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_constraint_layout_testing);
uniqueStringTextView = (TextView) findViewById(R.id.uniqueStringTextView);
}
private void generateUniqueId(){
uniqueString = Settings.Secure.getString(getApplicationContext().getContentResolver(), Secure.ANDROID_ID);
uniqueStringTextView.setText(uniqueString);
}
public void showUniqueIdButtonClick(View target){
generateUniqueId();
Log.d("ConstraintLayoutTesting", uniqueString);
}
}
| {
"content_hash": "e09c6468c8bd0ddef816c896d44eac7d",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 114,
"avg_line_length": 30,
"alnum_prop": 0.7583333333333333,
"repo_name": "Rangor/android-testing",
"id": "ec61f5102a0d1218d40cd031cd63c3389161d914",
"size": "1080",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/test/demo/myapp/activity/ConstraintLayoutTesting.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "103328"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Wed Dec 04 18:43:08 MST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.wildfly.swarm.orientdb Class Hierarchy (BOM: * : All 2.5.1.Final-SNAPSHOT API)</title>
<meta name="date" content="2019-12-04">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.wildfly.swarm.orientdb Class Hierarchy (BOM: * : All 2.5.1.Final-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.5.1.Final-SNAPSHOT</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/wildfly/swarm/opentracing/tracer/deployment/package-tree.html">Prev</a></li>
<li><a href="../../../../org/wildfly/swarm/remoting/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/wildfly/swarm/orientdb/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 class="title">Hierarchy For Package org.wildfly.swarm.orientdb</h1>
<span class="packageHierarchyLabel">Package Hierarchies:</span>
<ul class="horizontal">
<li><a href="../../../../overview-tree.html">All Packages</a></li>
</ul>
</div>
<div class="contentContainer">
<h2 title="Class Hierarchy">Class Hierarchy</h2>
<ul>
<li type="circle">java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Object</span></a>
<ul>
<li type="circle"><any>
<ul>
<li type="circle">org.wildfly.swarm.orientdb.<a href="../../../../org/wildfly/swarm/orientdb/OrientDBFraction.html" title="class in org.wildfly.swarm.orientdb"><span class="typeNameLink">OrientDBFraction</span></a> (implements org.wildfly.swarm.spi.api.<a href="../../../../org/wildfly/swarm/spi/api/Fraction.html" title="interface in org.wildfly.swarm.spi.api">Fraction</a><T>)</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.5.1.Final-SNAPSHOT</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/wildfly/swarm/opentracing/tracer/deployment/package-tree.html">Prev</a></li>
<li><a href="../../../../org/wildfly/swarm/remoting/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/wildfly/swarm/orientdb/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "36c8c5704ad91763cd958ab5bc4b0dfd",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 389,
"avg_line_length": 37.9448275862069,
"alnum_prop": 0.6304980007270083,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "c8d38cbed3b7c7acfd5ecd1b130ec5efdfde20cf",
"size": "5502",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2.5.1.Final-SNAPSHOT/apidocs/org/wildfly/swarm/orientdb/package-tree.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package com.zelory.kace.adressbook.ui;
import com.zelory.kace.adressbook.data.model.Person;
import javax.swing.*;
import java.util.List;
public class PersonListModel extends DefaultListModel<Person> {
public PersonListModel(List<Person> persons) {
super();
addElements(persons);
}
public void refreshWith(List<Person> persons) {
clear();
addElements(persons);
}
public void addElements(List<Person> persons) {
persons.forEach(this::addElement);
}
}
| {
"content_hash": "7ae02a7d12feedb7419aa80dce7fc89c",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 63,
"avg_line_length": 22.565217391304348,
"alnum_prop": 0.6801541425818882,
"repo_name": "zetbaitsu/Address_Book",
"id": "545be27ff9e7838d55ef7bf691c02c28c6822f8b",
"size": "519",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/zelory/kace/adressbook/ui/PersonListModel.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "35558"
}
],
"symlink_target": ""
} |
var IMpermanenceApp = angular.module('IMpermanenceApp', ['firebase', 'ui.router', 'angular-md5', 'ui.bootstrap']);
IMpermanenceApp.config(function ($stateProvider, $urlRouterProvider) {
var homeState = {
name: 'home',
url: '/',
cache: false,
templateUrl: 'splash/splash.html',
resolve: {
requireNoAuth: function ($state, Auth) {
return Auth.$requireSignIn().then(function (auth) {
$state.go('messenger');
},
function (error) {
return;
});
}
}
}
var loginState = {
name: 'login',
url: '/login',
cache: false,
controller: 'AuthCtrl as authCtrl',
templateUrl: 'auth/login.html',
resolve: {
requireNoAuth: function ($state, Auth) {
return Auth.$requireSignIn().then(function (auth) {
$state.go('home');
}, function (error) {
return;
});
}
}
}
var registerState = {
name: 'register',
url: '/register',
cache: false,
controller: 'AuthCtrl as authCtrl',
templateUrl: 'auth/register.html',
resolve: {
requireNoAuth: function ($state, Auth) {
return Auth.$requireSignIn().then(function (auth) {
$state.go('home');
}, function (error) {
return;
});
}
}
}
var profileState = {
name: 'profile',
url: '/profile',
cache: false,
controller: 'ProfileCtrl as profileCtrl',
templateUrl: 'users/profile.html',
resolve: {
auth: function ($state, Users, Auth) {
return Auth.$requireSignIn().catch(function () {
$state.go('home');
});
},
profile: function (Users, Auth) {
return Auth.$requireSignIn().then(function (auth) {
return Users.getProfile(auth.uid).$loaded();
});
}
}
}
var messengerState = {
name: 'messenger',
url: '/messenger',
cache: false,
controller: 'MessengerCtrl as messengerCtrl',
templateUrl: 'messenger/index.html',
resolve: {
channels: function (Channels) {
return Channels.$loaded();
},
profile: function ($state, Auth, Users) {
return Auth.$requireSignIn().then(function (auth) {
return Users.getProfile(auth.uid).$loaded().then(function (profile) {
return profile;
});
}, function (error) {
$state.go('home');
});
}
}
}
var messengerCreateState = {
name: 'messenger.create',
url: '/create',
cache: false,
controller: 'MessengerCtrl as messengerCtrl',
templateUrl: 'messenger/create.html'
}
var messengerMessageState = {
name: 'messenger.messages',
url: '/{channelId}/messages',
cache: false,
templateUrl: 'messenger/messages.html',
controller: 'MessagesCtrl as messagesCtrl',
resolve: {
messages: function ($stateParams, Messages) {
return Messages.forChannel($stateParams.channelId).$loaded();
},
channelName: function ($stateParams, channels) {
return '#' + channels.$getRecord($stateParams.channelId).name;
}
}
}
var messengerDirectState = {
name: 'messenger.direct',
url: '/{uid}/messages/direct',
cache: false,
templateUrl: 'messenger/messages.html',
controller: 'MessagesCtrl as messagesCtrl',
resolve: {
messages: function ($stateParams, Messages, profile) {
return Messages.forUsers($stateParams.uid, profile.$id).$loaded();
},
channelName: function ($stateParams, Users) {
return Users.all.$loaded().then(function () {
return '@' + Users.getDisplayName($stateParams.uid);
});
}
}
}
var logoutState = {
name: 'logout',
url: '/logout',
cache: false,
controller: "LogoutCtrl as logoutCtrl"
}
$stateProvider.state(homeState);
$stateProvider.state(loginState);
$stateProvider.state(registerState);
$stateProvider.state(profileState);
$stateProvider.state(messengerState);
$stateProvider.state(messengerCreateState);
$stateProvider.state(messengerMessageState);
$stateProvider.state(messengerDirectState);
$stateProvider.state(logoutState);
$urlRouterProvider.otherwise('/');
})
IMpermanenceApp.directive("drawing", function () {
return {
restrict: "A",
link: function (scope, element) {
var ctx = element[0].getContext('2d');
// variable that decides if something should be drawn on mousemove
var drawing = false;
// the last coordinates before the current move
var lastX;
var lastY;
element.bind('mousedown', function (event) {
if (event.offsetX !== undefined) {
lastX = event.offsetX;
lastY = event.offsetY;
} else { // Firefox compatibility
lastX = event.layerX - event.currentTarget.offsetLeft;
lastY = event.layerY - event.currentTarget.offsetTop;
}
// begins new line
ctx.beginPath();
drawing = true;
});
element.bind('mousemove', function (event) {
if (drawing) {
// get current mouse position
if (event.offsetX !== undefined) {
currentX = event.offsetX;
currentY = event.offsetY;
} else {
currentX = event.layerX - event.currentTarget.offsetLeft;
currentY = event.layerY - event.currentTarget.offsetTop;
}
draw(lastX, lastY, currentX, currentY);
// set current coordinates to last one
lastX = currentX;
lastY = currentY;
}
});
element.bind('mouseup', function (event) {
// stop drawing
drawing = false;
});
// canvas reset
function reset() {
element[0].width = element[0].width;
}
function draw(lX, lY, cX, cY) {
// line from
ctx.moveTo(lX, lY);
// to
ctx.lineTo(cX, cY);
// color
ctx.strokeStyle = "#4bf";
// draw it
ctx.stroke();
}
}
};
}); | {
"content_hash": "149297d2a187cdfb36f89e925ad9d56c",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 114,
"avg_line_length": 31.889867841409693,
"alnum_prop": 0.4825252106644564,
"repo_name": "MidonOrg/IMpermanence",
"id": "138f8d5e232f36b9f64ad47bac24afadeda24326",
"size": "7239",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "5865"
},
{
"name": "HTML",
"bytes": "12862"
},
{
"name": "JavaScript",
"bytes": "217226"
}
],
"symlink_target": ""
} |
console.log(typeof 3.14);
console.log(typeof true);
console.log(typeof '3.14');
console.log(typeof { 'key': 3.14 });
console.log(typeof Object);
console.log(typeof undefine);
console.log(typeof null);
| {
"content_hash": "d80a4fefd530db34bb1179ae672bce05",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 36,
"avg_line_length": 25.25,
"alnum_prop": 0.7227722772277227,
"repo_name": "wangding/demo-code",
"id": "6f029986d375005b4d4d0aae512b035e7d8c3b00",
"size": "202",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "node/test/javascript-basic-type.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "170743"
},
{
"name": "EJS",
"bytes": "6176"
},
{
"name": "HTML",
"bytes": "102398"
},
{
"name": "JavaScript",
"bytes": "1146241"
},
{
"name": "Pug",
"bytes": "430"
},
{
"name": "Python",
"bytes": "6987"
},
{
"name": "TypeScript",
"bytes": "6582"
},
{
"name": "Vue",
"bytes": "2273"
}
],
"symlink_target": ""
} |
"""
Copyright (c) 2015 SONATA-NFV
ALL RIGHTS RESERVED.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Neither the name of the SONATA-NFV [, ANY ADDITIONAL AFFILIATION]
nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
This work has been performed in the framework of the SONATA project,
funded by the European Commission under Grant number 671517 through
the Horizon 2020 and 5G-PPP programmes. The authors would like to
acknowledge the contributions of their colleagues of the SONATA
partner consortium (www.sonata-nfv.eu).
"""
import logging
import os
import time
import yaml
import paramiko
import tempfile
from collections import namedtuple
from ansible.parsing.dataloader import DataLoader
from ansible.vars.manager import VariableManager
from ansible.inventory.manager import InventoryManager
from ansible.executor.playbook_executor import PlaybookExecutor
from sonsmbase.smbase import sonSMbase
LOG = logging.getLogger(__name__)
LOG.setLevel(logging.DEBUG)
class FirewallFSM(sonSMbase):
def __init__(self):
"""
:param specific_manager_type: specifies the type of specific manager
that could be either fsm or ssm.
:param service_name: the name of the service that this specific manager
belongs to.
:param function_name: the name of the function that this specific
manager belongs to, will be null in SSM case
:param specific_manager_name: the actual name of specific manager
(e.g., scaling, placement)
:param id_number: the specific manager id number which is used to
distinguish between multiple SSM/FSM that are created for the same
objective (e.g., scaling with algorithm 1 and 2)
:param version: version
:param description: description
"""
self.specific_manager_type = 'fsm'
self.service_name = 'psa-service'
self.function_name = 'firewall-vnf'
self.specific_manager_name = 'firewall-config'
self.id_number = '1'
self.version = 'v0.1'
self.description = "An FSM that subscribes to start, stop and configuration topic for Firewall VNF"
self.is_running_in_emulator = 'SON_EMULATOR' in os.environ
LOG.debug('Running in the emulator is %s', self.is_running_in_emulator)
super(self.__class__, self).__init__(specific_manager_type=self.specific_manager_type,
service_name=self.service_name,
function_name=self.function_name,
specific_manager_name=self.specific_manager_name,
id_number=self.id_number,
version=self.version,
description=self.description)
def on_registration_ok(self):
# The fsm registration was successful
LOG.debug("Received registration ok event.")
# send the status to the SMR
status = 'Subscribed, waiting for alert message'
message = {'name': self.specific_manager_id,
'status': status}
self.manoconn.publish(topic='specific.manager.registry.ssm.status',
message=yaml.dump(message))
# Subscribing to the topics that the fsm needs to listen on
topic = "generic.fsm." + str(self.sfuuid)
self.manoconn.subscribe(self.message_received, topic)
LOG.info("Subscribed to " + topic + " topic.")
def message_received(self, ch, method, props, payload):
"""
This method handles received messages
"""
LOG.debug('<-- message_received app_id=%s', props.app_id)
# Decode the content of the message
request = yaml.load(payload)
# Don't trigger on non-request messages
if "fsm_type" not in request.keys():
LOG.info("Received a non-request message, ignoring...")
return
LOG.info('Handling message with fsm_type=%s', request["fsm_type"])
# Create the response
response = None
# the 'fsm_type' field in the content indicates for which type of
# fsm this message is intended. In this case, this FSM functions as
# start, stop and configure FSM
if str(request["fsm_type"]) == "start":
LOG.info("Start event received: " + str(request["content"]))
response = self.start_event(request["content"])
if str(request["fsm_type"]) == "stop":
LOG.info("Stop event received: " + str(request["content"]))
response = self.stop_event(request["content"])
if str(request["fsm_type"]) == "configure":
LOG.info("Config event received: " + str(request["content"]))
response = self.configure_event(request["content"])
if str(request["fsm_type"]) == "scale":
LOG.info("Scale event received: " + str(request["content"]))
response = self.scale_event(request["content"])
# If a response message was generated, send it back to the FLM
if response is not None:
# Generated response for the FLM
LOG.info("Response to request generated:" + str(response))
topic = "generic.fsm." + str(self.sfuuid)
corr_id = props.correlation_id
self.manoconn.notify(topic,
yaml.dump(response),
correlation_id=corr_id)
return
# If response is None:
LOG.info("Request received for other type of FSM, ignoring...")
def start_event(self, content):
"""
This method handles a start event.
"""
LOG.info("Performing life cycle start event")
LOG.info("content: " + str(content.keys()))
# TODO: Add the start logic. The content is a dictionary that contains
# the required data
vnfr = content["vnfr"]
mgmt_ip = None
vm_image = 'http://files.sonata-nfv.eu/son-psa-pilot/pfSense-vnf/' \
'pfSense.raw'
if (vnfr['virtual_deployment_units']
[0]['vm_image']) == vm_image:
mgmt_ip = (vnfr['virtual_deployment_units']
[0]['vnfc_instance'][0]['connection_points'][0]
['interface']['address'])
if not mgmt_ip:
LOG.error("Couldn't obtain mgmt IP address from VNFR during start")
return
#SSH connection to pfsense
port = 22
username = 'root'
password = 'pfsense'
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(
paramiko.AutoAddPolicy())
num_retries = 30
retry = 0
while retry < num_retries:
try:
ssh.connect(mgmt_ip, port, username, password)
break
except paramiko.BadHostKeyException as e:
LOG.info("Bad entry in ~/.ssh/known_hosts: %s", e)
retry += 1
except EOFError:
LOG.info('Unexpected Error from SSH Connection, retry in 5 seconds')
time.sleep(10)
retry += 1
except Exception as e:
LOG.info('SSH Connection refused from %s, will retry in 5 seconds (%s)', mgmt_ip, e)
time.sleep(10)
retry += 1
if retry == num_retries:
LOG.error('Could not establish SSH connection within max retries')
return;
#activate firewall
command = "pfctl -e"
(stdin, stdout, stderr) = ssh.exec_command(command)
ssh.close()
# Create a response for the FLM
response = {}
response['status'] = 'COMPLETED'
# TODO: complete the response
return response
def stop_event(self, content):
"""
This method handles a stop event.
"""
LOG.info("Performing life cycle stop event")
LOG.info("content: " + str(content.keys()))
# TODO: Add the stop logic. The content is a dictionary that contains
# the required data
vnfr = content["vnfr"]
mgmt_ip = None
vm_image = 'http://files.sonata-nfv.eu/son-psa-pilot/pfSense-vnf/' \
'pfSense.raw'
if (vnfr['virtual_deployment_units']
[0]['vm_image']) == vm_image:
mgmt_ip = (vnfr['virtual_deployment_units']
[0]['vnfc_instance'][0]['connection_points'][0]
['interface']['address'])
if not mgmt_ip:
LOG.error("Couldn't obtain IP address from VNFR during stop")
return
#SSH connection to pfsense
port = 22
username = 'root'
password = 'pfsense'
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(
paramiko.AutoAddPolicy())
ssh.connect(mgmt_ip, port, username, password)
#desactivate firewall
command = "pfctl -d"
(stdin, stdout, stderr) = ssh.exec_command(command)
ssh.close()
# Create a response for the FLM
response = {}
response['status'] = 'COMPLETED'
# TODO: complete the response
return response
def configure_event(self, content):
"""
This method handles a configure event.
"""
LOG.info("Performing life cycle configure event")
LOG.info("content: " + str(content.keys()))
# TODO: Add the configure logic. The content is a dictionary that
# contains the required data
nsr = content['nsr']
vnfrs = content['vnfrs']
if self.is_running_in_emulator:
result = self.fw_configure(vnfrs[1]) # TODO: the order can be random
response = {'status': 'COMPLETED' if result else 'ERROR' }
return response
mgmt_ip = None
vm_image = 'http://files.sonata-nfv.eu/son-psa-pilot/pfSense-vnf/' \
'pfsense.raw'
for x in range(len(vnfrs)):
if (vnfrs[x]['virtual_deployment_units']
[0]['vm_image']) == vm_image:
mgmt_ip = (vnfrs[x]['virtual_deployment_units']
[0]['vnfc_instance'][0]['connection_points'][0]
['interface']['address'])
if not mgmt_ip:
LOG.error("Couldn't obtain mgmt IP address from VNFR during configuration")
return
#SSH connection to pfsense
port = 22
username = 'root'
password = 'pfsense'
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(
paramiko.AutoAddPolicy())
ssh.connect(mgmt_ip, port, username, password)
#Activate firewall
command = "pfctl -e"
(stdin, stdout, stderr) = ssh.exec_command(command)
ssh.close()
# Create a response for the FLM
response = {}
response['status'] = 'COMPLETED'
# TODO: complete the response
return response
def scale_event(self, content):
"""
This method handles a scale event.
"""
LOG.info("Performing life cycle scale event")
LOG.info("content: " + str(content.keys()))
# TODO: Add the configure logic. The content is a dictionary that
# contains the required data
# Create a response for the FLM
response = {}
response['status'] = 'COMPLETED'
# TODO: complete the response
return response
def fw_configure(self, fw_vnfr):
fw_cpinput_ip = '10.30.0.2'
fw_cpinput_netmask = '255.255.255.252'
fw_cpinput_network = '10.30.0.2/30'
# configure vm using ansible playbook
loader = DataLoader()
with tempfile.NamedTemporaryFile() as fp:
fp.write(b'[firewallserver]\n')
if self.is_running_in_emulator:
fp.write(b'mn.vnf_fw')
else:
fp.write(mgmt_ip.encode('utf-8'))
fp.flush()
inventory = InventoryManager(loader=loader, sources=[fp.name])
variable_manager = VariableManager(loader=loader, inventory=inventory)
playbook_path = os.path.abspath('./ansible/site.yml')
LOG.debug('Targeting the ansible playbook: %s', playbook_path)
if not os.path.exists(playbook_path):
LOG.error('The playbook does not exist')
return False
Options = namedtuple('Options',
['listtags', 'listtasks', 'listhosts',
'syntax', 'connection', 'module_path',
'forks', 'remote_user', 'private_key_file',
'ssh_common_args', 'ssh_extra_args',
'sftp_extra_args', 'scp_extra_args',
'become', 'become_method', 'become_user',
'verbosity', 'check', 'diff'])
options = Options(listtags=False, listtasks=False, listhosts=False,
syntax=False, connection='ssh', module_path=None,
forks=100, remote_user='slotlocker',
private_key_file=None, ssh_common_args=None,
ssh_extra_args=None, sftp_extra_args=None,
scp_extra_args=None, become=True,
become_method=None, become_user='root',
verbosity=None, check=False, diff=True)
options = options._replace(connection='docker', become=False)
variable_manager.extra_vars = {'FW_CPINPUT_NETWORK': fw_cpinput_network,
'SON_EMULATOR': self.is_running_in_emulator }
pbex = PlaybookExecutor(playbooks=[playbook_path],
inventory=inventory,
variable_manager=variable_manager,
loader=loader, options=options,
passwords={})
results = pbex.run()
return True
def main(working_dir=None):
if working_dir:
os.chdir(working_dir)
LOG.info('Welcome to the main in %s', __name__)
FirewallFSM()
while True:
time.sleep(10)
if __name__ == '__main__':
main()
| {
"content_hash": "1790c1aaad971ad7e143069b413cc726",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 107,
"avg_line_length": 38.060759493670886,
"alnum_prop": 0.5709724624185181,
"repo_name": "lconceicao/son-security-pilot",
"id": "d0b09be56afb882f5b3ce37ff2e7f6fe136729f7",
"size": "15034",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "fsm/firewall-config/firewall/firewall.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "5157"
},
{
"name": "Python",
"bytes": "134145"
},
{
"name": "Shell",
"bytes": "4049"
}
],
"symlink_target": ""
} |
<?php
namespace ZendTest\ComponentInstaller;
use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamDirectory;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Framework\TestCase;
use Zend\ComponentInstaller\Collection;
use Zend\ComponentInstaller\ConfigDiscovery;
use Zend\ComponentInstaller\ConfigOption;
use Zend\ComponentInstaller\Injector;
use Zend\ComponentInstaller\Injector\InjectorInterface;
use Zend\ComponentInstaller\Injector\NoopInjector;
use function array_shift;
use function get_class;
use function gettype;
use function is_object;
use function sprintf;
class ConfigDiscoveryTest extends TestCase
{
/** @var vfsStreamDirectory */
private $projectRoot;
/** @var ConfigDiscovery\ */
private $discovery;
/** @var Collection */
private $allTypes;
/** @var string[] */
private $injectorTypes;
protected function setUp() : void
{
$this->projectRoot = vfsStream::setup('project');
$this->discovery = new ConfigDiscovery();
$this->allTypes = new Collection([
InjectorInterface::TYPE_CONFIG_PROVIDER,
InjectorInterface::TYPE_COMPONENT,
InjectorInterface::TYPE_MODULE,
]);
$this->injectorTypes = [
Injector\ApplicationConfigInjector::class,
// Injector\ConfigAggregatorInjector::class,
Injector\ConfigInjectorChain::class,
// Injector\ExpressiveConfigInjector::class,
Injector\ModulesConfigInjector::class,
];
}
public function createApplicationConfig()
{
vfsStream::newFile('config/application.config.php')
->at($this->projectRoot)
->setContent('<' . "?php\nreturn [\n 'modules' => [\n ]\n];");
}
public function createDevelopmentConfig($dist = true)
{
$configFileName = 'config/development.config.php' . ($dist ? '.dist' : '');
vfsStream::newFile($configFileName)
->at($this->projectRoot)
->setContent('<' . "?php\nreturn [\n 'modules' => [\n ]\n];");
}
public function createDevelopmentWorkConfig()
{
$this->createDevelopmentConfig(false);
}
public function createAggregatorConfig()
{
vfsStream::newFile('config/config.php')
->at($this->projectRoot)
->setContent('<' . "?php\n\$aggregator = new ConfigAggregator([\n]);");
}
public function createExpressiveConfig()
{
vfsStream::newFile('config/config.php')
->at($this->projectRoot)
->setContent('<' . "?php\n\$configManager = new ConfigManager([\n]);");
}
public function createModulesConfig()
{
vfsStream::newFile('config/modules.config.php')
->at($this->projectRoot)
->setContent('<' . "?php\nreturn [\n]);");
}
public function assertOptionsContainsNoopInjector(Collection $options)
{
if ($options->isEmpty()) {
throw new ExpectationFailedException('Options array is empty; no NoopInjector found!');
}
$options = $options->toArray();
$injector = array_shift($options)->getInjector();
if (! $injector instanceof NoopInjector) {
throw new ExpectationFailedException('Options array does not contain a NoopInjector!');
}
}
public function assertOptionsContainsInjector($injectorType, Collection $options)
{
foreach ($options as $option) {
if (! $option instanceof ConfigOption) {
throw new ExpectationFailedException(sprintf(
'Invalid option returned: %s',
is_object($option) ? get_class($option) : gettype($option)
));
}
if ($injectorType === get_class($option->getInjector())) {
return $option->getInjector();
}
}
throw new ExpectationFailedException(sprintf(
'Injector of type %s was not found in the options',
$injectorType
));
}
public function assertOptionsContainsInjectorInChain($injectorType, Collection $options)
{
$chain = $this->assertOptionsContainsInjector(Injector\ConfigInjectorChain::class, $options);
foreach ($chain->getCollection() as $injector) {
if (! $injector instanceof InjectorInterface) {
throw new ExpectationFailedException(sprintf(
'Invalid Injector returned: %s',
is_object($injector) ? get_class($injector) : gettype($injector)
));
}
if ($injectorType === get_class($injector)) {
return;
}
}
throw new ExpectationFailedException(sprintf(
'Injector of type %s was not found in the options',
$injectorType
));
}
public function testGetAvailableConfigOptionsReturnsEmptyArrayWhenNoConfigFilesPresent()
{
$result = $this->discovery->getAvailableConfigOptions($this->allTypes);
$this->assertInstanceOf(Collection::class, $result);
$this->assertTrue($result->isEmpty());
}
public function testGetAvailableConfigOptionsReturnsOptionsForEachSupportedPackageType()
{
$this->createApplicationConfig();
$this->createDevelopmentConfig();
$this->createAggregatorConfig();
$this->createExpressiveConfig();
$this->createModulesConfig();
$options = $this->discovery->getAvailableConfigOptions($this->allTypes, vfsStream::url('project'));
$this->assertCount(5, $options);
$this->assertOptionsContainsNoopInjector($options);
foreach ($this->injectorTypes as $injector) {
$this->assertOptionsContainsInjector($injector, $options);
}
}
public function configFileSubset()
{
return [
[
'seedMethod' => 'createApplicationConfig',
'type' => InjectorInterface::TYPE_COMPONENT,
'expected' => Injector\ApplicationConfigInjector::class,
'chain' => false,
],
[
'seedMethod' => 'createApplicationConfig',
'type' => InjectorInterface::TYPE_MODULE,
'expected' => Injector\ApplicationConfigInjector::class,
'chain' => false,
],
[
'seedMethod' => 'createAggregatorConfig',
'type' => InjectorInterface::TYPE_CONFIG_PROVIDER,
'expected' => Injector\ConfigAggregatorInjector::class,
'chain' => true,
],
[
'seedMethod' => 'createAggregatorConfig',
'type' => InjectorInterface::TYPE_CONFIG_PROVIDER,
'expected' => Injector\ConfigAggregatorInjector::class,
'chain' => true,
],
[
'seedMethod' => 'createDevelopmentConfig',
'type' => InjectorInterface::TYPE_COMPONENT,
'expected' => Injector\DevelopmentConfigInjector::class,
'chain' => true,
],
[
'seedMethod' => 'createDevelopmentConfig',
'type' => InjectorInterface::TYPE_MODULE,
'expected' => Injector\DevelopmentConfigInjector::class,
'chain' => true,
],
[
'seedMethod' => 'createDevelopmentWorkConfig',
'type' => InjectorInterface::TYPE_COMPONENT,
'expected' => Injector\DevelopmentWorkConfigInjector::class,
'chain' => true,
],
[
'seedMethod' => 'createDevelopmentWorkConfig',
'type' => InjectorInterface::TYPE_MODULE,
'expected' => Injector\DevelopmentWorkConfigInjector::class,
'chain' => true,
],
[
'seedMethod' => 'createExpressiveConfig',
'type' => InjectorInterface::TYPE_CONFIG_PROVIDER,
'expected' => Injector\ExpressiveConfigInjector::class,
'chain' => true,
],
[
'seedMethod' => 'createExpressiveConfig',
'type' => InjectorInterface::TYPE_CONFIG_PROVIDER,
'expected' => Injector\ExpressiveConfigInjector::class,
'chain' => true,
],
[
'seedMethod' => 'createModulesConfig',
'type' => InjectorInterface::TYPE_COMPONENT,
'expected' => Injector\ModulesConfigInjector::class,
'chain' => false,
],
[
'seedMethod' => 'createModulesConfig',
'type' => InjectorInterface::TYPE_MODULE,
'expected' => Injector\ModulesConfigInjector::class,
'chain' => false,
],
];
}
/**
* @dataProvider configFileSubset
*
* @param string $seedMethod
* @param string $type
* @param string $expected
* @param bool $chain
*/
public function testGetAvailableConfigOptionsCanReturnsSubsetOfOptionsBaseOnPackageType(
$seedMethod,
$type,
$expected,
$chain
) {
$this->{$seedMethod}();
$options = $this->discovery->getAvailableConfigOptions(new Collection([$type]), vfsStream::url('project'));
$this->assertCount(2, $options);
$this->assertOptionsContainsNoopInjector($options);
if ($chain) {
$this->assertOptionsContainsInjectorInChain($expected, $options);
} else {
$this->assertOptionsContainsInjector($expected, $options);
}
}
public function testNoOptionReturnedIfInjectorCannotRegisterType()
{
$this->createApplicationConfig();
$options = $this->discovery->getAvailableConfigOptions(
new Collection([InjectorInterface::TYPE_CONFIG_PROVIDER]),
vfsStream::url('project')
);
$this->assertInstanceOf(Collection::class, $options);
$this->assertTrue($options->isEmpty());
}
}
| {
"content_hash": "2ffe236eff3a72ea278b9c3ef398dea0",
"timestamp": "",
"source": "github",
"line_count": 295,
"max_line_length": 115,
"avg_line_length": 35.15593220338983,
"alnum_prop": 0.5667727316555781,
"repo_name": "zendframework/zend-component-installer",
"id": "26ac5338b5e2b4a4089b3333f5b409fd241f4a12",
"size": "10684",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/ConfigDiscoveryTest.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "PHP",
"bytes": "207965"
}
],
"symlink_target": ""
} |
require "uri"
require "json"
require "net/http"
url = URI("https://www.googleapis.com/geolocation/v1/geolocate?key=YOUR_API_KEY")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = "application/json"
request.body = JSON.dump({
"cellTowers": [
{
"cellId": 170402199,
"locationAreaCode": 35632,
"mobileCountryCode": 310,
"mobileNetworkCode": 410,
"age": 0,
"signalStrength": -60,
"timingAdvance": 15
}
]
})
response = https.request(request)
puts response.read_body
# [END maps_http_geolocation_celltowers] | {
"content_hash": "61fd03f1c4cb73334da4c03287983e06",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 81,
"avg_line_length": 21.896551724137932,
"alnum_prop": 0.6566929133858268,
"repo_name": "googlemaps/openapi-specification",
"id": "0e5c92205543d49164f03b744ba9997392031f91",
"size": "678",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "dist/snippets/maps_http_geolocation_celltowers/maps_http_geolocation_celltowers.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Starlark",
"bytes": "11394"
},
{
"name": "TypeScript",
"bytes": "71469"
}
],
"symlink_target": ""
} |
/*
Point of Sale System Project
Authors: Clayton Barber, Brandon Barton, Declan Brennan, Maximilian Hasselbusch, Eric Metcalf
Last Updated: 20 November 2015
*/
package pos;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.JFrame;
public class AddNewItem extends javax.swing.JFrame {
Connection con;
/**
* Creates new form AddNewItem
*
* @param con
*/
public AddNewItem(Connection con) {
this.con = con;
initComponents();
this.setLocationRelativeTo(null);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
INL = new javax.swing.JLabel();
IName = new javax.swing.JTextField();
IPL = new javax.swing.JLabel();
Price = new javax.swing.JTextField();
Submit = new javax.swing.JButton();
Cancel = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel2.setBackground(new java.awt.Color(51, 51, 255));
jLabel1.setText("Add New Item");
jLabel2.setText("WPS");
jPanel1.setBackground(new java.awt.Color(0, 51, 255));
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Item Information"));
INL.setText("Item Name");
IPL.setText("Price");
Submit.setText("Submit");
Submit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
SubmitActionPerformed(evt);
}
});
Cancel.setText("Cancel");
Cancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CancelActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(IName)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(INL)
.addComponent(IPL))
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(Price)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(Cancel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(Submit)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(INL)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(IName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(IPL)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Price, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Submit)
.addComponent(Cancel))
.addGap(6, 6, 6))
);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(223, 223, 223)
.addComponent(jLabel2)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void SubmitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SubmitActionPerformed
String pid = null;
String name = IName.getText();
String price = Price.getText();
if (name.equals("") || price.equals("")) {
IName.setText("Invalid input, fields cannot be null");
Price.setText("");
} else if (!checkString(price)) {
IName.setText("Invalid input, price price cannot be NaN");
Price.setText("Do not include '$'");
} else {
try {
Statement s = con.createStatement();
ResultSet result = s.executeQuery("select getpid from dual");
result.next();
pid = result.getNString(1);
} catch (SQLException sqe) {
System.err.println("Unable to select pid from dual");
System.err.println(sqe.getMessage());
}
try {
Statement s = con.createStatement();
s.executeUpdate("insert into ITEM values('" + pid + "', '" + name + "', '" + price + "')");
this.dispose();
UpdateSuccessful us = new UpdateSuccessful();
} catch (SQLException sqe) {
System.err.println("Unable to add item");
System.err.println(sqe.getMessage());
}
}
}//GEN-LAST:event_SubmitActionPerformed
private void CancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CancelActionPerformed
this.dispose();
}//GEN-LAST:event_CancelActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton Cancel;
private javax.swing.JLabel INL;
private javax.swing.JTextField IName;
private javax.swing.JLabel IPL;
private javax.swing.JTextField Price;
private javax.swing.JButton Submit;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
// End of variables declaration//GEN-END:variables
private boolean checkString(String price) {
if (price.isEmpty()) {
return false;
}
for (int i = 0; i < price.length(); i++) {
if (i == 0 && price.charAt(i) == '-') {
if (price.length() == 1) {
return false;
} else {
continue;
}
}
if (price.charAt(i) != '.' && (Character.digit(price.charAt(i), 10) < 0)) {
return false;
}
}
return true;
}
}
| {
"content_hash": "a3f73f0b7a6df16431d199d6a7b2f897",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 156,
"avg_line_length": 45.14222222222222,
"alnum_prop": 0.6250861474844934,
"repo_name": "mhasselbusch/point_of_sale",
"id": "1085b893f07faa922c02d1144f6cb1808aae2dfc",
"size": "10157",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/pos/AddNewItem.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "305418"
},
{
"name": "Makefile",
"bytes": "74"
}
],
"symlink_target": ""
} |
Subsets and Splits