org.hardtokenmgmt.admin.control
Class HTMFWSImpl

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

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

Implementation of several control interfaces targeted against HTMFWS.

Version:
$Id$
Author:
Philip Vendil 19 apr 2009

Field Summary
 
Fields inherited from interface org.hardtokenmgmt.admin.control.IAdminAuthorizer
RESOURCE_CAACTICATION, RESOURCE_EDITADMINS, RESOURCE_HOSTSTATUS
 
Constructor Summary
HTMFWSImpl()
           
 
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 should fetch the current HostInfoVO for all the configured hosts
 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
 

Constructor Detail

HTMFWSImpl

public HTMFWSImpl()
Method Detail

editAdmin

public void editAdmin(AdminDataVO adminData)
               throws java.io.IOException,
                      org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception,
                      AdminDataException
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.
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.
AdminDataException - if the adminData parameter contained erroneous data.
See Also:
IAdministratorPriviledgesManager.editAdmin(org.hardtokenmgmt.admin.common.AdminDataVO)

getHostStatuses

public OverallStatus getHostStatuses()
Description copied from interface: IHostStatusFetcher
Method that should fetch the current HostInfoVO for all the configured hosts

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

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.
See Also:
IAdministratorPriviledgesManager.existsAdministrator(org.hardtokenmgmt.admin.common.AdminDataVO)

getAdministrators

public java.util.List<AdminDataVO> getAdministrators(java.lang.String orgId)
                                              throws java.io.IOException,
                                                     org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception
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.
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.
See Also:
IAdministratorPriviledgesManager.getAdministrators(java.lang.String)

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.
See Also:
IAdministratorPriviledgesManager.getAvailableAdminGroups(java.lang.String)

removeAdministrator

public void removeAdministrator(AdminDataVO adminData)
                         throws java.io.IOException,
                                org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception,
                                AdminDataException
Description copied from interface: IAdministratorPriviledgesManager
Removes the administrator privileges from a user.

Specified by:
removeAdministrator in interface IAdministratorPriviledgesManager
Parameters:
adminData - information about the administrator.
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.
AdminDataException - if the adminData parameter contained erroneous data.
See Also:
IAdministratorPriviledgesManager.removeAdministrator(org.hardtokenmgmt.admin.common.AdminDataVO)

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
See Also:
ICAManager.activateCA(java.lang.String, int, java.lang.String)

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
See Also:
ICAManager.deactivateCA(java.lang.String, int)

getOrganisations

public java.util.List<OrganizationVO> getOrganisations()
                                                throws java.io.IOException,
                                                       org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception
Specified by:
getOrganisations in interface IOrganizationManager
Returns:
a list of the name of available organization for the current administrator.
Throws:
java.io.IOException - if communication exception occurred.
org.hardtokenmgmt.ws.gen.AuthorizationDeniedException_Exception

isAuthorizedToEdit

public boolean isAuthorizedToEdit(java.lang.String resource)
                           throws java.io.IOException
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
Throws:
java.io.IOException - if communication error occurs

isAuthorizedToView

public boolean isAuthorizedToView(java.lang.String resource)
                           throws java.io.IOException
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
Throws:
java.io.IOException

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