Account.java 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. /**
  2. * Licensed Materials - Property of IBM
  3. *
  4. * IBM Cognos Products: CAMAAA
  5. *
  6. * (C) Copyright IBM Corp. 2005, 2012
  7. *
  8. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
  9. * IBM Corp.
  10. */
  11. import java.util.HashMap;
  12. import java.util.Locale;
  13. import java.util.Set;
  14. import java.util.Vector;
  15. import com.cognos.CAM_AAA.authentication.IAccount;
  16. @SuppressWarnings("rawtypes")
  17. public class Account extends UiClass implements IAccount
  18. {
  19. /**
  20. * Creates a IBM Cognos 8 Account
  21. *
  22. * @param theObjectID
  23. * The unique identifier for the account.
  24. */
  25. public Account(String theObjectID)
  26. {
  27. super(theObjectID);
  28. businessPhone = null;
  29. email = null;
  30. contentLocale = null;
  31. productLocale = null;
  32. faxPhone = null;
  33. givenName = null;
  34. homePhone = null;
  35. mobilePhone = null;
  36. pagerPhone = null;
  37. postalAddress = null;
  38. surname = null;
  39. userName = null;
  40. customProperties = null;
  41. }
  42. /*
  43. * (non-Javadoc)
  44. *
  45. * @see com.cognos.CAM_AAA.authentication.IAccount#getBusinessPhone()
  46. */
  47. public String getBusinessPhone()
  48. {
  49. return businessPhone;
  50. }
  51. /*
  52. * (non-Javadoc)
  53. *
  54. * @see com.cognos.CAM_AAA.authentication.IAccount#getEmail()
  55. */
  56. public String getEmail()
  57. {
  58. return email;
  59. }
  60. /*
  61. * (non-Javadoc)
  62. *
  63. * @see com.cognos.CAM_AAA.authentication.IAccount#getContentLocale()
  64. */
  65. public Locale getContentLocale()
  66. {
  67. return contentLocale;
  68. }
  69. /*
  70. * (non-Javadoc)
  71. *
  72. * @see com.cognos.CAM_AAA.authentication.IAccount#getFaxPhone()
  73. */
  74. public String getFaxPhone()
  75. {
  76. return faxPhone;
  77. }
  78. /*
  79. * (non-Javadoc)
  80. *
  81. * @see com.cognos.CAM_AAA.authentication.IAccount#getGivenName()
  82. */
  83. public String getGivenName()
  84. {
  85. return givenName;
  86. }
  87. /*
  88. * (non-Javadoc)
  89. *
  90. * @see com.cognos.CAM_AAA.authentication.IAccount#getHomePhone()
  91. */
  92. public String getHomePhone()
  93. {
  94. return homePhone;
  95. }
  96. /*
  97. * (non-Javadoc)
  98. *
  99. * @see com.cognos.CAM_AAA.authentication.IAccount#getMobilePhone()
  100. */
  101. public String getMobilePhone()
  102. {
  103. return mobilePhone;
  104. }
  105. /*
  106. * (non-Javadoc)
  107. *
  108. * @see com.cognos.CAM_AAA.authentication.IAccount#getPagerPhone()
  109. */
  110. public String getPagerPhone()
  111. {
  112. return pagerPhone;
  113. }
  114. /*
  115. * (non-Javadoc)
  116. *
  117. * @see com.cognos.CAM_AAA.authentication.IAccount#getPostalAddress()
  118. */
  119. public String getPostalAddress()
  120. {
  121. return postalAddress;
  122. }
  123. /*
  124. * (non-Javadoc)
  125. *
  126. * @see com.cognos.CAM_AAA.authentication.IAccount#getProductLocale()
  127. */
  128. public Locale getProductLocale()
  129. {
  130. return productLocale;
  131. }
  132. /*
  133. * (non-Javadoc)
  134. *
  135. * @see com.cognos.CAM_AAA.authentication.IAccount#getSurname()
  136. */
  137. public String getSurname()
  138. {
  139. return surname;
  140. }
  141. /*
  142. * (non-Javadoc)
  143. *
  144. * @see com.cognos.CAM_AAA.authentication.IAccount#getUserName()
  145. */
  146. public String getUserName()
  147. {
  148. return userName;
  149. }
  150. /**
  151. * Sets the business phone property.
  152. *
  153. * @param theBusinessPhone
  154. * The business phone number value.
  155. */
  156. public void setBusinessPhone(String theBusinessPhone)
  157. {
  158. businessPhone = theBusinessPhone;
  159. }
  160. /**
  161. * Sets the content locale property.
  162. *
  163. * @param theContentLocale
  164. * The content locale value.
  165. */
  166. public void setContentLocale(Locale theContentLocale)
  167. {
  168. contentLocale = theContentLocale;
  169. }
  170. /**
  171. * Sets the email property.
  172. *
  173. * @param theEmail
  174. * The email value.
  175. */
  176. public void setEmail(String theEmail)
  177. {
  178. email = theEmail;
  179. }
  180. /**
  181. * Sets the fax phone number property.
  182. *
  183. * @param theFaxPhone
  184. * The fax phone number value.
  185. */
  186. public void setFaxPhone(String theFaxPhone)
  187. {
  188. faxPhone = theFaxPhone;
  189. }
  190. /**
  191. * Sets the given name property.
  192. *
  193. * @param theGivenName
  194. * The given name value.
  195. */
  196. public void setGivenName(String theGivenName)
  197. {
  198. givenName = theGivenName;
  199. }
  200. /**
  201. * Sets the home phone number property.
  202. *
  203. * @param theHomephone
  204. * The home phone number value.
  205. */
  206. public void setHomePhone(String theHomephone)
  207. {
  208. homePhone = theHomephone;
  209. }
  210. /**
  211. * Sets the mobile phone number property.
  212. *
  213. * @param theMobilePhone
  214. * The mobile phone number value.
  215. */
  216. public void setMobilePhone(String theMobilePhone)
  217. {
  218. mobilePhone = theMobilePhone;
  219. }
  220. /**
  221. * Sets the pager phone number property.
  222. *
  223. * @param thePagerPhone
  224. * The pager phone number value.
  225. */
  226. public void setPagerPhone(String thePagerPhone)
  227. {
  228. pagerPhone = thePagerPhone;
  229. }
  230. /**
  231. * Sets the postal address property.
  232. *
  233. * @param thePostalAddress
  234. * The postal address value.
  235. */
  236. public void setPostalAddress(String thePostalAddress)
  237. {
  238. postalAddress = thePostalAddress;
  239. }
  240. /**
  241. * @param theProductLocale
  242. */
  243. public void setProductLocale(Locale theProductLocale)
  244. {
  245. productLocale = theProductLocale;
  246. }
  247. /**
  248. * @param theSurname
  249. */
  250. public void setSurname(String theSurname)
  251. {
  252. surname = theSurname;
  253. }
  254. /**
  255. * @param theUsername
  256. */
  257. public void setUserName(String theUsername)
  258. {
  259. userName = theUsername;
  260. }
  261. /*
  262. * (non-Javadoc)
  263. *
  264. * @see com.cognos.CAM_AAA.authentication.IAccount#getCustomPropertyNames()
  265. */
  266. public String[] getCustomPropertyNames()
  267. {
  268. if (customProperties != null)
  269. {
  270. Set keySet = this.customProperties.keySet();
  271. return (String[]) keySet.toArray(new String[keySet.size()]);
  272. }
  273. return null;
  274. }
  275. /*
  276. * (non-Javadoc)
  277. *
  278. * @see com.cognos.CAM_AAA.authentication.IAccount#getCustomPropertyValue(java.lang.String)
  279. */
  280. public String[] getCustomPropertyValue(String theName)
  281. {
  282. if (customProperties != null)
  283. {
  284. Vector v = (Vector) this.customProperties.get(theName);
  285. if (v != null)
  286. {
  287. return (String[]) v.toArray(new String[v.size()]);
  288. }
  289. }
  290. return null;
  291. }
  292. /**
  293. * Adds a custom property for an account.
  294. *
  295. * @param theName
  296. * The name of the property to add.
  297. * @param theValue
  298. * The value of the property to add.
  299. */
  300. public void addCustomProperty(String theName, String theValue)
  301. {
  302. if (customProperties == null)
  303. {
  304. customProperties = new HashMap();
  305. }
  306. Vector v = (Vector) this.customProperties.get(theName);
  307. if (v == null)
  308. {
  309. v = new Vector();
  310. this.customProperties.put(theName, v);
  311. }
  312. v.add(theValue);
  313. }
  314. private String businessPhone;
  315. private String email;
  316. private Locale contentLocale;
  317. private Locale productLocale;
  318. private String faxPhone;
  319. private String givenName;
  320. private String homePhone;
  321. private String mobilePhone;
  322. private String pagerPhone;
  323. private String postalAddress;
  324. private String surname;
  325. private String userName;
  326. private HashMap customProperties;
  327. }