se.entra.phantom.server.rconsole
Class AdminConfigProtection

java.lang.Object
  extended by se.entra.phantom.server.rconsole.AdminConfigProtection

public class AdminConfigProtection
extends Object

Handles a protection definition.


Constructor Summary
AdminConfigProtection()
          Create a normal item for security check.
AdminConfigProtection(String data)
          Creates a protection from a string in the INI file.
AdminConfigProtection(String[] data)
          Creates a protection definition from a string array from a list box.
AdminConfigProtection(String name, String realm, boolean doAuthenticate, boolean allowBasic, int sslRequired, Hashtable groups)
          Creates a resource from a string in the INI file that was previously in the resource definition.
AdminConfigProtection(VirtualPanel vp)
          Creates a protection resource from a panel.
 
Method Summary
static String checkOwnerSecurityGranted(AdminConfigProtection owner, AdminConfigProtection item)
          Checks two resources, an owner and a new item.
 String checkSecurityGranted(AdminConfigProtection item)
          Checks two resources, an owner and a new item.
 String getListBoxString()
          Gets the listbox string for this resource.
 String getName()
          Gets the name of this access control.
 String getProtectionID()
          Gets the protection ID.
 String getRealm()
          Gets the realm string of this resource.
 AdminConfigSecureLogin getSecureLoginProfile()
          Gets the secure login profile instance for this access control.
 String getSecureLoginProfileName()
          Gets the SecureLogin profile name.
 AdminConfigUser getUserDefinition(String userID)
          Gets a user configuration definition defined as member of a group for this protection.
 boolean hasDomain(String name)
          Checks if a domain ID is used by this protection definition/access control.
 boolean hasGroups()
          Checks if this protection has groups assigned to it.
static boolean hasNoProtection(String realm, boolean doAuthenticate, boolean allowBasic, int sslRequired, Hashtable groups)
          Checks if this protection has no migration protection.
 boolean isAuthenticationRequired()
          Checks if authentication is required.
 boolean isBasicAllowed()
          Checks if Basic authentication is allowed.
 boolean isClientCertificatePresentOnServerRequired()
          Checks if client certificate is required for SSL.
 boolean isClientCertificateRequired()
          Checks if client certificate is required for SSL.
 boolean isDomainAddressAllowed(SocketNameInterface sni)
          Checks if a connection is allowed or denied depending on the domain specification.
 boolean isMigrationProtection(String realm, boolean doAuthenticate, boolean allowBasic, int sslRequired, Hashtable groups)
          Checks if this protection matches a migration protection in order not to duplicate them.
 boolean isSSLRequired()
          Checks if SSL is required.
 boolean isStrongEncryptionRequired()
          Checks if strong SSL encryption is required.
static void performListSelectionChange(VirtualPanel vp, VirtualCListBox list, int line, boolean hasSelection, Hashtable groups, Hashtable domains)
          Performs a list selection change in the resource definition panel.
 void resolveDomainReferences(Hashtable domains)
          Resolves all references to domains.
 void setItem(IniFile ini)
          Sets the item in the ini file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminConfigProtection

public AdminConfigProtection(VirtualPanel vp)
Creates a protection resource from a panel.


AdminConfigProtection

public AdminConfigProtection(String[] data)
                      throws IOException
Creates a protection definition from a string array from a list box.

Throws:
IOException - when the data doesn't have the correct format.

AdminConfigProtection

public AdminConfigProtection(String data)
                      throws IOException
Creates a protection from a string in the INI file.

Throws:
IOException - when the data doesn't have the correct format.

AdminConfigProtection

public AdminConfigProtection(String name,
                             String realm,
                             boolean doAuthenticate,
                             boolean allowBasic,
                             int sslRequired,
                             Hashtable groups)
Creates a resource from a string in the INI file that was previously in the resource definition.


AdminConfigProtection

public AdminConfigProtection()
Create a normal item for security check. This means no groups or domains with all default settings.

Method Detail

checkOwnerSecurityGranted

public static String checkOwnerSecurityGranted(AdminConfigProtection owner,
                                               AdminConfigProtection item)
Checks two resources, an owner and a new item. The new item must have the same or less security requirements imposed on it.

Returns:
null for OK, otherwise an error string.

getName

public String getName()
Gets the name of this access control.


hasNoProtection

public static boolean hasNoProtection(String realm,
                                      boolean doAuthenticate,
                                      boolean allowBasic,
                                      int sslRequired,
                                      Hashtable groups)
Checks if this protection has no migration protection.


isMigrationProtection

public boolean isMigrationProtection(String realm,
                                     boolean doAuthenticate,
                                     boolean allowBasic,
                                     int sslRequired,
                                     Hashtable groups)
Checks if this protection matches a migration protection in order not to duplicate them.


resolveDomainReferences

public void resolveDomainReferences(Hashtable domains)
Resolves all references to domains.


performListSelectionChange

public static void performListSelectionChange(VirtualPanel vp,
                                              VirtualCListBox list,
                                              int line,
                                              boolean hasSelection,
                                              Hashtable groups,
                                              Hashtable domains)
Performs a list selection change in the resource definition panel.


isSSLRequired

public boolean isSSLRequired()
Checks if SSL is required.


isStrongEncryptionRequired

public boolean isStrongEncryptionRequired()
Checks if strong SSL encryption is required.


isAuthenticationRequired

public boolean isAuthenticationRequired()
Checks if authentication is required.


isBasicAllowed

public boolean isBasicAllowed()
Checks if Basic authentication is allowed.


hasGroups

public boolean hasGroups()
Checks if this protection has groups assigned to it.


getUserDefinition

public AdminConfigUser getUserDefinition(String userID)
Gets a user configuration definition defined as member of a group for this protection. The group must be active in order to be returned, but not the user.

Returns:
null if not found.

checkSecurityGranted

public String checkSecurityGranted(AdminConfigProtection item)
Checks two resources, an owner and a new item. The new item must have the same or less security requirements imposed on it.

Returns:
null for OK, otherwise an error string.

getListBoxString

public String getListBoxString()
Gets the listbox string for this resource.


getProtectionID

public String getProtectionID()
Gets the protection ID.


getRealm

public String getRealm()
Gets the realm string of this resource. This is used for WWW-authentication.


hasDomain

public boolean hasDomain(String name)
Checks if a domain ID is used by this protection definition/access control.


isDomainAddressAllowed

public boolean isDomainAddressAllowed(SocketNameInterface sni)
Checks if a connection is allowed or denied depending on the domain specification.


isClientCertificateRequired

public boolean isClientCertificateRequired()
Checks if client certificate is required for SSL.


isClientCertificatePresentOnServerRequired

public boolean isClientCertificatePresentOnServerRequired()
Checks if client certificate is required for SSL.


getSecureLoginProfileName

public String getSecureLoginProfileName()
Gets the SecureLogin profile name.

Returns:
null if none is specified.

getSecureLoginProfile

public AdminConfigSecureLogin getSecureLoginProfile()
                                             throws Exception
Gets the secure login profile instance for this access control.

Returns:
null if none is defined.
Throws:
Exception - if the secure login profile cannot be found.

setItem

public void setItem(IniFile ini)
Sets the item in the ini file.



Phantom® and NetPhantom® are registered trademarks of Codectica Systems SARL.
© Copyright Codectica Systems SARL, 2008. All rights reserved.