Skip to content
Snippets Groups Projects
communication.js 3.15 KiB
Newer Older
Mathis Neumann's avatar
Mathis Neumann committed
import Measurable from './measurable';
Mathis Neumann's avatar
Mathis Neumann committed
import attr from 'ember-data/attr';

Mathis Neumann's avatar
Mathis Neumann committed
/**
 * represents an abstract communication which groups multiple CommunicationInstances
 * @class Communication
 * @extends Measurable
Mathis Neumann's avatar
Mathis Neumann committed
 */
Mathis Neumann's avatar
Mathis Neumann committed
const Model = Measurable.extend({
Mathis Neumann's avatar
Mathis Neumann committed
    /**
     * name of the technology used for communication
     * @property technology
     * @type String
     */
Mathis Neumann's avatar
Mathis Neumann committed
    technology: attr('string'),
Mathis Neumann's avatar
Mathis Neumann committed
    /**
     * id of the sending ServiceInstance
Mathis Neumann's avatar
Mathis Neumann committed
     * @property sourceId
     * @type String
     */
    sourceId: attr('string'),
     * id of the receiving ServiceInstance
     * @property targetId
Mathis Neumann's avatar
Mathis Neumann committed
     * @type String
     */
Christoph Dornieden's avatar
Christoph Dornieden committed
    targetId: attr('string'),

    /**
     * The amount of workload. Shows how many requests where sent via this connection
     * @property workload
     * @type Number
     */
Christoph Dornieden's avatar
Christoph Dornieden committed
    workload: attr('number')
Mathis Neumann's avatar
Mathis Neumann committed
});

Model.reopenClass({
    FIXTURES: [
       {
          "type":"communication",
          "id":"test-system123-communication-1",
          "changelogSequence":0,
          "lastUpdate":"2016-06-20T12:46:29.818+02:00",
          "revisionNumber":0,
          "systemId":"system123",
          "sourceId":"test-system123-service-1",
          "targetId":"test-system123-service-2",
          "technology":"REST"
       },
       {
          "type":"communication",
          "id":"test-system123-communication-2",
          "changelogSequence":0,
          "lastUpdate":"2016-06-20T12:46:29.818+02:00",
          "revisionNumber":0,
          "systemId":"system123",
          "sourceId":"test-system123-service-2",
          "targetId":"test-system123-service-3",
          "technology":"TCP/IP"
       },
       {
          "type":"communication",
          "id":"test-system123-communication-3",
          "changelogSequence":0,
          "lastUpdate":"2016-06-20T12:46:29.818+02:00",
          "revisionNumber":0,
          "systemId":"system123",
          "sourceId":"test-system123-service-3",
          "targetId":"test-system123-service-4",
          "technology":"TCP/IP"
       },
       {
          "type":"communication",
          "id":"test-system123-communication-4",
          "changelogSequence":0,
          "lastUpdate":"2016-06-20T12:46:29.818+02:00",
          "revisionNumber":0,
          "systemId":"system123",
          "sourceId":"test-system123-service-3",
          "targetId":"test-system123-service-5",
          "technology":"TCP/IP"
       },
       {
          "type":"communication",
          "id":"test-system123-communication-5",
          "changelogSequence":0,
          "lastUpdate":"2016-06-20T12:46:29.818+02:00",
          "revisionNumber":0,
          "systemId":"system123",
          "sourceId":"test-system123-service-4",
          "targetId":"test-system123-service-5",
          "technology":"TCP/IP"
       },
       {
          "type":"communication",
          "id":"test-system123-communication-6",
          "changelogSequence":0,
          "lastUpdate":"2016-06-20T12:46:29.818+02:00",
          "revisionNumber":0,
          "systemId":"system123",
          "sourceId":"test-system123-service-5",
          "targetId":"test-system123-service-6",
          "technology":"TCP/IP"
       }
    ]
});

export default Model;