org.hardtokenmgmt.admin.control
Class DummyImpl

java.lang.Object
  extended by org.hardtokenmgmt.admin.control.BaseHostStatusFetcher
      extended by org.hardtokenmgmt.admin.control.DummyImpl
All Implemented Interfaces:
IAdminAuthorizer, IAdministratorPriviledgesManager, ICAManager, IHostStatusFetcher, IOrganizationManager

public class DummyImpl
extends BaseHostStatusFetcher
implements ICAManager, IOrganizationManager, IAdministratorPriviledgesManager, IAdminAuthorizer

DummyImplementation of a IHostInfoFetcher that retrieves information about the local host.

Version:
$Id$
Author:
Philip Vendil 18 feb 2009

Field Summary
static java.lang.String cert1String
           
static java.lang.String cert2String
           
static java.lang.String dummyCRLData
           
 
Fields inherited from interface org.hardtokenmgmt.admin.control.IAdminAuthorizer
RESOURCE_CAACTICATION, RESOURCE_EDITADMINS, RESOURCE_HOSTSTATUS
 
Constructor Summary
DummyImpl()
           
 
Method Summary
 CAInfoVO activateCA(java.lang.String hostname, int id, java.lang.String authCode)
          Method used to activate a CA at a specific host.
 CAInfoVO deactivateCA(java.lang.String hostname, int id)
          Method used to deactivate a CA at a specific host.
 void editAdmin(AdminDataVO adminData)
          Adds/edits the data of a given administrator.
 boolean existsAdministrator(AdminDataVO adminData)
          Checks if an administrator already exists.
 java.util.List<AdminDataVO> getAdministrators(java.lang.String orgId)
          Returns a list of administrators belonging to the given organization
 java.util.List<AdminGroupVO> getAvailableAdminGroups(java.lang.String orgId)
          Returns the available administration groups for the given organization.
 OverallStatus getHostStatuses()
          Method that fetches information about the local host
 java.security.cert.X509CRL getLastCRL(int caId)
          Method used to fetch the latest CRL of a given CA.
 java.util.List<OrganizationVO> getOrganisations()
           
 boolean isAuthorizedToEdit(java.lang.String resource)
          Checks if the current administrator is authorized to edit the given resource.
 boolean isAuthorizedToView(java.lang.String resource)
          Checks if the current administrator is authorized to view the given resource.
 void removeAdministrator(AdminDataVO adminData)
          Removes the administrator privileges from a user.
 
Methods inherited from class org.hardtokenmgmt.admin.control.BaseHostStatusFetcher
isHostMonitored, setHostAsMonitored
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cert1String

public static java.lang.String cert1String

cert2String

public static java.lang.String cert2String

dummyCRLData

public static java.lang.String dummyCRLData
Constructor Detail

DummyImpl

public DummyImpl()
Method Detail

getHostStatuses

public OverallStatus getHostStatuses()
Method that fetches information about the local host

Specified by:
getHostStatuses in interface IHostStatusFetcher
Returns:
an OverallStatus for all the configured hosts
See Also:
IHostStatusFetcher.getHostStatuses()

activateCA

public CAInfoVO activateCA(java.lang.String hostname,
                           int id,
                           java.lang.String authCode)
                    throws java.io.IOException,
                           org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception
Description copied from interface: ICAManager
Method used to activate a CA at a specific host.

Specified by:
activateCA in interface ICAManager
Parameters:
hostname - of the host to containing the CAs to activate.
id - the id of CA to activate.
authCode - the authentication code used to activate.
Returns:
a CAInfoVO containing information about the current status if this CA.
Throws:
java.io.IOException - if communication exception occurred.
org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception

deactivateCA

public CAInfoVO deactivateCA(java.lang.String hostname,
                             int id)
                      throws java.io.IOException,
                             org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception
Description copied from interface: ICAManager
Method used to deactivate a CA at a specific host.

Specified by:
deactivateCA in interface ICAManager
Parameters:
hostname - of the host to containing the CAs to activate.
id - the id of CA to deactivate
Returns:
a CAInfoVO containing information about the current status if this CA.
Throws:
java.io.IOException - if communication exception occurred.
org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception

getOrganisations

public java.util.List<OrganizationVO> getOrganisations()
Specified by:
getOrganisations in interface IOrganizationManager
Returns:
a list of the name of available organization for the current administrator.

editAdmin

public void editAdmin(AdminDataVO adminData)
Description copied from interface: IAdministratorPriviledgesManager
Adds/edits the data of a given administrator.

Specified by:
editAdmin in interface IAdministratorPriviledgesManager
Parameters:
adminData - information about the administrator and the administration groups he should belong to.

getAdministrators

public java.util.List<AdminDataVO> getAdministrators(java.lang.String orgId)
Description copied from interface: IAdministratorPriviledgesManager
Returns a list of administrators belonging to the given organization

Specified by:
getAdministrators in interface IAdministratorPriviledgesManager
Parameters:
orgId - the unique id of the organization
Returns:
all administrators belonging to the organization.

getAvailableAdminGroups

public java.util.List<AdminGroupVO> getAvailableAdminGroups(java.lang.String orgId)
                                                     throws java.io.IOException,
                                                            org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception
Description copied from interface: IAdministratorPriviledgesManager
Returns the available administration groups for the given organization.

Specified by:
getAvailableAdminGroups in interface IAdministratorPriviledgesManager
Parameters:
orgId - the unique id of the organization
Returns:
a list of administration groups
Throws:
java.io.IOException - if communication problems occurred.
org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception - if the administrator wasn't authorized to perform the given operation.

removeAdministrator

public void removeAdministrator(AdminDataVO adminData)
Description copied from interface: IAdministratorPriviledgesManager
Removes the administrator privileges from a user.

Specified by:
removeAdministrator in interface IAdministratorPriviledgesManager
Parameters:
adminData - information about the administrator.

existsAdministrator

public boolean existsAdministrator(AdminDataVO adminData)
                            throws java.io.IOException,
                                   org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception
Description copied from interface: IAdministratorPriviledgesManager
Checks if an administrator already exists.

Specified by:
existsAdministrator in interface IAdministratorPriviledgesManager
Parameters:
adminData - information about the administrator.
Returns:
true if the given administrator already exists
Throws:
java.io.IOException - if communication problems occurred.
org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception - if the administrator wasn't authorized to perform the given operation.

isAuthorizedToEdit

public boolean isAuthorizedToEdit(java.lang.String resource)
Description copied from interface: IAdminAuthorizer
Checks if the current administrator is authorized to edit the given resource.

Specified by:
isAuthorizedToEdit in interface IAdminAuthorizer
Parameters:
resource - one of RESOURCE_ parameters
Returns:
true if authorized to edit given resource

isAuthorizedToView

public boolean isAuthorizedToView(java.lang.String resource)
Description copied from interface: IAdminAuthorizer
Checks if the current administrator is authorized to view the given resource.

Specified by:
isAuthorizedToView in interface IAdminAuthorizer
Parameters:
resource - one of RESOURCE_ parameters
Returns:
true if authorized to view given resource

getLastCRL

public java.security.cert.X509CRL getLastCRL(int caId)
                                      throws java.io.IOException,
                                             org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception
Description copied from interface: ICAManager
Method used to fetch the latest CRL of a given CA.

Specified by:
getLastCRL in interface ICAManager
Parameters:
caId - of CA to fetch CRL for.
Returns:
The latest CRL of the given CA or null, if no CRL have been generated yet.
Throws:
java.io.IOException - if communication exception occurred.
org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception