Visa.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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.Vector;
  12. import com.cognos.CAM_AAA.authentication.IAccount;
  13. import com.cognos.CAM_AAA.authentication.IBiBusHeader;
  14. import com.cognos.CAM_AAA.authentication.ICredential;
  15. import com.cognos.CAM_AAA.authentication.IGroup;
  16. import com.cognos.CAM_AAA.authentication.IRole;
  17. import com.cognos.CAM_AAA.authentication.ITrustedCredential;
  18. import com.cognos.CAM_AAA.authentication.IVisa;
  19. import com.cognos.CAM_AAA.authentication.SystemRecoverableException;
  20. import com.cognos.CAM_AAA.authentication.UnrecoverableException;
  21. import com.cognos.CAM_AAA.authentication.UserRecoverableException;
  22. public class Visa implements IVisa
  23. {
  24. /**
  25. *
  26. */
  27. public Visa()
  28. {
  29. super();
  30. roles = null;
  31. groups = null;
  32. }
  33. /**
  34. * @param theAccount
  35. * @throws UnrecoverableException
  36. */
  37. public void init(IAccount theAccount) throws UnrecoverableException
  38. {
  39. account = theAccount;
  40. }
  41. /**
  42. * @throws UnrecoverableException
  43. */
  44. public void destroy() throws UnrecoverableException
  45. {
  46. roles = null;
  47. groups = null;
  48. account = null;
  49. }
  50. /*
  51. * (non-Javadoc)
  52. *
  53. * @see com.cognos.CAM_AAA.authentication.IVisa#generateTrustedCredential(com.cognos.CAM_AAA.authentication.IBiBusHeader)
  54. */
  55. public ITrustedCredential generateTrustedCredential(
  56. IBiBusHeader theAuthRequest) throws UserRecoverableException,
  57. SystemRecoverableException, UnrecoverableException
  58. {
  59. return null;
  60. }
  61. /*
  62. * (non-Javadoc)
  63. *
  64. * @see com.cognos.CAM_AAA.authentication.IVisa#generateCredential(com.cognos.CAM_AAA.authentication.IBiBusHeader)
  65. */
  66. public ICredential generateCredential(IBiBusHeader theAuthRequest)
  67. throws UserRecoverableException, SystemRecoverableException,
  68. UnrecoverableException
  69. {
  70. return null;
  71. }
  72. /*
  73. * (non-Javadoc)
  74. *
  75. * @see com.cognos.CAM_AAA.authentication.IVisa#isValid()
  76. */
  77. public boolean isValid()
  78. {
  79. return true;
  80. }
  81. /*
  82. * (non-Javadoc)
  83. *
  84. * @see com.cognos.CAM_AAA.authentication.IVisa#getAccount()
  85. */
  86. public IAccount getAccount()
  87. {
  88. return account;
  89. }
  90. /**
  91. * @param theGroup
  92. */
  93. public void addGroup(IGroup theGroup)
  94. {
  95. if (groups == null)
  96. {
  97. groups = new Vector();
  98. }
  99. groups.add(theGroup);
  100. }
  101. /*
  102. * (non-Javadoc)
  103. *
  104. * @see com.cognos.CAM_AAA.authentication.IVisa#getGroups()
  105. */
  106. public IGroup[] getGroups()
  107. {
  108. if (groups != null)
  109. {
  110. IGroup[] array = new IGroup[groups.size()];
  111. return (IGroup[]) groups.toArray(array);
  112. }
  113. return null;
  114. }
  115. /**
  116. * @param theRole
  117. */
  118. public void addRole(IRole theRole)
  119. {
  120. if (roles == null)
  121. {
  122. roles = new Vector();
  123. }
  124. roles.add(theRole);
  125. }
  126. /*
  127. * (non-Javadoc)
  128. *
  129. * @see com.cognos.CAM_AAA.authentication.IVisa#getRoles()
  130. */
  131. public IRole[] getRoles()
  132. {
  133. if (roles != null)
  134. {
  135. IRole[] array = new IRole[roles.size()];
  136. return (IRole[]) roles.toArray(array);
  137. }
  138. return null;
  139. }
  140. private Vector roles;
  141. private Vector groups;
  142. private IAccount account;
  143. }