summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-05-02 03:53:18 -0700
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-05-02 06:59:21 -0700
commit94ee92559b051f2f82ed681f841f4f13016842ed (patch)
tree9760a0ad7da03572ed4c9dc596c4b0f537e64112 /bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
parent43bbca64032716730d2e7795b6569d5fdbda9d12 (diff)
[MSO-8] Second step of the rebase for MSO
Second rebase containing additional features for MSO + total reworking of the BPMN structure + Notification flow can now be added at the end of some BPMN flows Change-Id: I7e937c7a0ba1593ca85e164a093f79c7e38b6ce0 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml62
1 files changed, 31 insertions, 31 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
index 130f95e171..3dbfcce36f 100644
--- a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
+++ b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
@@ -1,31 +1,31 @@
-<!--
- ============LICENSE_START=======================================================
- ECOMP MSO
- ================================================================================
- Copyright (C) 2017 AT&T Intellectual Property. 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.
- ============LICENSE_END=========================================================
- -->
-
-<jboss-deployment-structure>
- <deployment>
- <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
- <exclusions>
- <module name="org.apache.log4j" />
- <module name="org.slf4j" />
- <module name="org.slf4j.impl" />
- </exclusions>
- </deployment>
-</jboss-deployment-structure>
-
+<!--
+ ============LICENSE_START=======================================================
+ ECOMP MSO
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. 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.
+ ============LICENSE_END=========================================================
+ -->
+
+<jboss-deployment-structure>
+ <deployment>
+ <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
+ <exclusions>
+ <module name="org.apache.log4j" />
+ <module name="org.slf4j" />
+ <module name="org.slf4j.impl" />
+ </exclusions>
+ </deployment>
+</jboss-deployment-structure>
+
color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*!
 * Copyright (C) 2017 AT&T Intellectual Property. 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.
 */
const queue = {
	fetch: [],
	put: [],
	post: [],
	destroy: []
};

const initQueue = () => {
	queue['fetch'] = [];
	queue['put'] = [];
	queue['post'] = [];
	queue['destroy'] = [];
};

const handleOperation = (handler, options) => {
	if(typeof handler === 'function') {
		return Promise.resolve(handler(options));
	}
	else {
		return Promise.resolve(handler);
	}
};

export default {

	fetch(baseUrl, options) {
		const {fetch} = queue;
		if(!fetch.length) {
			throw new Error(`Fetch operation was called without proper handler. baseUrl: '${baseUrl}' options: '${options}'`);
		}
		return handleOperation(fetch.shift(), {options, baseUrl});
	},

	put(baseUrl, data, options) {
		const {put} = queue;
		if(!put.length) {
			throw new Error(`put operation was called without proper handler. baseUrl: '${baseUrl}' options: '${options}'`);
		}
		return handleOperation(put.shift(), {data, options, baseUrl});
	},

	post(baseUrl, data, options) {
		const {post} = queue;
		if(!post.length) {
			throw new Error(`post operation was called without proper handler. baseUrl: '${baseUrl}' options: '${options}'`);
		}
		return handleOperation(post.shift(), {data, options, baseUrl});
	},

	destroy(baseUrl, options) {
		const {destroy} = queue;
		if(!destroy.length) {
			throw new Error(`Destroy operation was called without proper handler. baseUrl: '${baseUrl}' options: '${options}'`);
		}
		return handleOperation(destroy.shift(), {options, baseUrl});
	},

	addHandler(operation, handler) {
		queue[operation].push(handler);
	},

	resetQueue() {
		initQueue();
	},

	checkEmptyQueue() {
		let isEmpty = true;
		let message = 'Check following calls: ';
		for (let operationType in queue) {
			if (queue[operationType].length > 0) {
				isEmpty = false;
				message += operationType;
			}
		}
		if (!isEmpty) {
			throw new Error('Queue is not empty, ' + message);
		}
	}
};