diff options
Diffstat (limited to 'node_modules/montage/data/store-connection-information.js')
-rw-r--r-- | node_modules/montage/data/store-connection-information.js | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/node_modules/montage/data/store-connection-information.js b/node_modules/montage/data/store-connection-information.js new file mode 100644 index 00000000..f8eabbcd --- /dev/null +++ b/node_modules/montage/data/store-connection-information.js | |||
@@ -0,0 +1,126 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | /** | ||
7 | @module montage/data/store-connection-information | ||
8 | @requires montage/core/core | ||
9 | @requires montage/core/logger | ||
10 | */ | ||
11 | var Montage = require("montage").Montage; | ||
12 | var logger = require("core/logger").logger("store-connection-information"); | ||
13 | /** | ||
14 | @class module:montage/data/store-connection-information.StoreConnectionInformation | ||
15 | @extends module:montage/core/core.Montage | ||
16 | */ | ||
17 | var StoreConnectionInformation = exports.StoreConnectionInformation = Montage.create(Montage, /** @lends module:montage/data/store-connection-information.StoreConnectionInformation# */ { | ||
18 | |||
19 | initWithNameAndInformation:{ | ||
20 | value:function (name, url, username, password) { | ||
21 | this._name = name; | ||
22 | this._url = url; | ||
23 | this._username = username; | ||
24 | this._password = password; | ||
25 | return this; | ||
26 | } | ||
27 | }, | ||
28 | |||
29 | equals:{ | ||
30 | value:function (other) { | ||
31 | if (!other) { | ||
32 | return false; | ||
33 | } | ||
34 | var otherMetadata = Montage.getInfoForObject(other); | ||
35 | if (!otherMetadata) { | ||
36 | return false; | ||
37 | } | ||
38 | var thisMetadata = Montage.getInfoForObject(this); | ||
39 | if ((otherMetadata.objectName === thisMetadata.objectName) && (otherMetadata.moduleId === thisMetadata.moduleId)) { | ||
40 | return (this._name === other._name) && (this._url === other._url) && (this._username === other._username) && (this._password === other._password); | ||
41 | } | ||
42 | return false; | ||
43 | } | ||
44 | }, | ||
45 | |||
46 | /** | ||
47 | @private | ||
48 | */ | ||
49 | _name:{ | ||
50 | serializable:true, | ||
51 | enumerable:false, | ||
52 | value:null | ||
53 | }, | ||
54 | |||
55 | /** | ||
56 | Name of the object. The name is used to identify the connection information. | ||
57 | @function | ||
58 | @returns {String} this._name | ||
59 | */ | ||
60 | name:{ | ||
61 | get:function () { | ||
62 | return this._name; | ||
63 | } | ||
64 | }, | ||
65 | |||
66 | /** | ||
67 | @private | ||
68 | */ | ||
69 | _url:{ | ||
70 | serializable:true, | ||
71 | enumerable:false, | ||
72 | value:null | ||
73 | }, | ||
74 | |||
75 | /** | ||
76 | Returns the connection url. | ||
77 | @function | ||
78 | @returns this._url | ||
79 | */ | ||
80 | url:{ | ||
81 | get:function () { | ||
82 | return this._url; | ||
83 | } | ||
84 | }, | ||
85 | |||
86 | /** | ||
87 | @private | ||
88 | */ | ||
89 | _username:{ | ||
90 | serializable:true, | ||
91 | enumerable:false, | ||
92 | value:null | ||
93 | }, | ||
94 | |||
95 | /** | ||
96 | Returns the connection username. | ||
97 | @function | ||
98 | @returns this._username | ||
99 | */ | ||
100 | username:{ | ||
101 | get:function () { | ||
102 | return this._username; | ||
103 | } | ||
104 | }, | ||
105 | |||
106 | /** | ||
107 | @private | ||
108 | */ | ||
109 | _password:{ | ||
110 | serializable:true, | ||
111 | enumerable:false, | ||
112 | value:null | ||
113 | }, | ||
114 | |||
115 | /** | ||
116 | Returns the connection password. | ||
117 | @function | ||
118 | @returns this._password | ||
119 | */ | ||
120 | password:{ | ||
121 | get:function () { | ||
122 | return this._password; | ||
123 | } | ||
124 | } | ||
125 | |||
126 | }); | ||