issrg.pba.management.manager
Class PManagement.PMAgentReference

java.lang.Object
  extended by issrg.pba.management.manager.PManagement.PMAgentReference
Enclosing class:
PManagement

public final class PManagement.PMAgentReference
extends java.lang.Object

PERMIS agemt reference.

An instance of this class represents a reference to a PERMIS Agent, the agentNumber is the integer used in the PMConfiguration for this agent reference.

Further the connection state is held in this object.

The normal flow of connection state is: "Inactive" -> "Attempt" -> "Active" -> "Finish" -> "Inactive"

The "Failed" state, can happen form: "Attempt", "Active" or "Finish"

And the "Attempt" state, can happen after the "Failed" state.

Version:
0.6.2008.06.20
Author:
mfb4@kent.ac.uk

Field Summary
static int CONNECTION_ACTIVE
           
static int CONNECTION_ATTEMPT
           
static int CONNECTION_FAILED
           
static int CONNECTION_FINISHED
           
static int CONNECTION_INACTIVE
           
 
Method Summary
 java.lang.Integer agentNumber()
          get the unique integer assigned to this agentReference.
 void connect()
          connect, make a connection to the PERMIS agent.
 void connectStop()
          This method instructs the the current connection attempt, to Stop.
 void disconnect()
          disconnect.
 PMException getCommunicationException()
          get the last communication exception.
 int getConnectionCount()
          get the current value of the connection count.
 PMException getConnectionException()
          get the last connection exception.
 int getConnectionState()
          Get the state of the connection.
 java.lang.String getHost()
          Get the host name of where the PERMIS agent is located on the network.
 java.lang.String getHostStore()
          Get the LDAP or WebDAV host.
 java.lang.String getLDAPACName()
          Get the LDAP attribute name for ACs.
 java.lang.String getLDAPVersion()
          Get the LDAP directory Version.
 java.io.File getLocalFile()
          get the File object that identifies the local file.
 java.lang.String getName()
          Get the cosmetic name that identifies the Reference to the PERMIS agent.
 PManagement getPManagement()
          get the PManagement model.
 java.lang.String getPolicyName()
          Get the current policy name.
 java.lang.String getPort()
          Get the port number that the PERMIS agent is listening on.
 java.lang.String getPortStore()
          Get the LDAP or WebDAV port.
 java.lang.String getSSLContextProvider()
          Get the SSL context provider.
 java.lang.String getSSLContextService()
          Get the SSL context service.
 java.lang.String getSSLEnabledCipherSuites()
          Get the SSL enabled cipher suites.
 java.lang.String getSSLEnabledProtocols()
          Get the SSL enabled protocols.
 java.lang.String getSSLSecureRandomNumberProvider()
          Get the secure random number provider.
 java.lang.String getSSLSecureRandomNumberService()
          Get the secure random number service.
 java.lang.String getStoreType()
          The type of storage used to store the PERMIS Policy.
 java.lang.String getUpdatePolicyResponse()
          get the update policy response.
 boolean isConnectionStateActive()
          Is the connection state active.
 boolean isConnectionStateAttempt()
          Is the connection state attempting connection.
 boolean isConnectionStateFailed()
          Did the connection fail.
 boolean isConnectionStateFinished()
          Is the connection state Finished.
 boolean isConnectionStateInactive()
          Is the connection state Inactive.
 boolean isStoreTypeFile()
          If the policy exists in the local file store.
 boolean isStoreTypeLDAP()
          If the policy exists in an LDAP directory.
 boolean isStoreTypeTextFile()
          Returns true if the policy lives in a text file.
 boolean isStoreTypeWebDAV()
          If the policy exists in a WebDAV directory.
 boolean isUpdatingPolicy()
          get the updating policy flag.
 void setCommunicationException(PMException communicationExceptionParam)
          set the last communication exception.
 void setConnectionCount(int connectCountParam)
          Update the connection count.
 void setHost(java.lang.String value)
          Set the host name of where the PERMIS agent is located on the network.
 void setHostStore(java.lang.String hostStoreParam)
          Set the LDAP or WebDAV host.
 void setLDAPACName(java.lang.String ldapACNameParam)
          Set the LDAP attribute name for ACs.
 void setLDAPVersion(java.lang.String ldapVersionParam)
          Set the LDAP directory Version.
 void setLocalFile(java.io.File localFileParam)
          set the File object that identifies the local file.
 void setName(java.lang.String value)
          Set the cosmetic name that identifies the reference to the PERMIS agent.
 void setPolicyName(java.lang.String policyNameParam)
          Set the current policy name.
 void setPort(java.lang.String value)
          Set the port number that the PERMIS agent is listening on.
 void setPortStore(java.lang.String portStoreParam)
          Set the LDAP or WebDAV port.
 void setSSLContextProvider(java.lang.String value)
          Set the SSL context provider.
 void setSSLContextService(java.lang.String value)
          Set the SSL context service.
 void setSSLEnabledCipherSuites(java.lang.String value)
          Set the SSL enabled cipher suites.
 void setSSLEnabledProtocols(java.lang.String value)
          Set the SSL enabled protocols.
 void setSSLSecureRandomNumberProvider(java.lang.String value)
          Set the secure random number provider.
 void setSSLSecureRandomNumberService(java.lang.String value)
          Set the secure random number service.
 void setStoreTypeFile()
          Sets storage type to be the local File.
 void setStoreTypeLDAP()
          Set the storage type to a remote LDAP directory.
 void setStoreTypeTextFile()
          Sets storage type to be a local text file.
 void setStoreTypeWebDAV()
          Set storage type to a remote WebDAV directory.
 void updatePolicy()
          Fire off the process that actually updates the PERMIS policy associated with the PERMIS agent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTION_INACTIVE

public static final int CONNECTION_INACTIVE
See Also:
Constant Field Values

CONNECTION_ATTEMPT

public static final int CONNECTION_ATTEMPT
See Also:
Constant Field Values

CONNECTION_ACTIVE

public static final int CONNECTION_ACTIVE
See Also:
Constant Field Values

CONNECTION_FAILED

public static final int CONNECTION_FAILED
See Also:
Constant Field Values

CONNECTION_FINISHED

public static final int CONNECTION_FINISHED
See Also:
Constant Field Values
Method Detail

agentNumber

public java.lang.Integer agentNumber()
get the unique integer assigned to this agentReference.

Returns:
the unique number associated with the PERMIS agent reference
Since:
0.1.2008.01.28

getPManagement

public PManagement getPManagement()
get the PManagement model. that contains this AgentReference.

Returns:
the top model.
Since:
0.6.2008.06.23

connect

public void connect()
connect, make a connection to the PERMIS agent.

if all goes well a PManager is created

a connection object "PMConnect" is created and the run method invoked in a new thread, in order that the calling thread can continue and not have to wait for a process that can take several seconds.

Since:
0.6.2008.06.19

disconnect

public void disconnect()
disconnect. If there is an active connection, this will close it down.

Since:
0.1.2008.01.31

connectStop

public void connectStop()
This method instructs the the current connection attempt, to Stop.

Since:
0.5.2008.06.12

getConnectionState

public int getConnectionState()
Get the state of the connection.

Returns:
the state of the connection.
Since:
0.6.2008.06.19

isConnectionStateInactive

public boolean isConnectionStateInactive()
Is the connection state Inactive. NOT connected.

Returns:
true if the connection is inactive
Since:
0.6.2008.06.19

isConnectionStateAttempt

public boolean isConnectionStateAttempt()
Is the connection state attempting connection.

Returns:
true if the connection is being attempted
Since:
0.6.2008.06.19

isConnectionStateActive

public boolean isConnectionStateActive()
Is the connection state active. Connected

Returns:
true if the connection exists to the PERMIS agent
Since:
0.6.2008.06.19

isConnectionStateFinished

public boolean isConnectionStateFinished()
Is the connection state Finished. disconnected.

Returns:
true if the last connection is closing down
Since:
0.6.2008.06.19

isConnectionStateFailed

public boolean isConnectionStateFailed()
Did the connection fail. The last connection attempt failed.

Returns:
true it the last connectin attempt failed
Since:
0.6.2008.06.19

setConnectionCount

public void setConnectionCount(int connectCountParam)
Update the connection count.

Parameters:
connectCountParam - the current count.
Since:
0.6.2008.06.21

getConnectionCount

public int getConnectionCount()
get the current value of the connection count. which should be incremented every second while a connection is being attempted.

Returns:
the current connection count.
Since:
0.6.2008.06.21

getConnectionException

public PMException getConnectionException()
get the last connection exception. This is the latest exception that was generated by either the PMConnect of PManager. if there is one.

Returns:
the last exception.
Since:
0.6.2008.06.21

getLocalFile

public java.io.File getLocalFile()
get the File object that identifies the local file. That contains the PERMIS policy.

Returns:
the local file.
Since:
0.6.2008.06.21

setLocalFile

public void setLocalFile(java.io.File localFileParam)
set the File object that identifies the local file. That contains the PERMIS policy.

Parameters:
localFileParam - the Attribute Certificate file that contains the PERMIS Policy
Since:
0.6.2008.06.23

getStoreType

public java.lang.String getStoreType()
The type of storage used to store the PERMIS Policy.

Returns:
the storage type.
Since:
0.6.2008.06.21

isStoreTypeFile

public boolean isStoreTypeFile()
If the policy exists in the local file store.

Returns:
true if the store type is a local File
Since:
0.6.2008.06.23

isStoreTypeLDAP

public boolean isStoreTypeLDAP()
If the policy exists in an LDAP directory.

Returns:
true if the store type is a remote LDAP directory
Since:
0.6.2008.06.23

isStoreTypeWebDAV

public boolean isStoreTypeWebDAV()
If the policy exists in a WebDAV directory.

Returns:
true if the store type is a remote WebDAV directory
Since:
0.6.2008.06.23

isStoreTypeTextFile

public boolean isStoreTypeTextFile()
Returns true if the policy lives in a text file.

Returns:
true if the store type is a local text file

setStoreTypeFile

public void setStoreTypeFile()
Sets storage type to be the local File.

Since:
0.6.2008.06.23

setStoreTypeTextFile

public void setStoreTypeTextFile()
Sets storage type to be a local text file.


setStoreTypeLDAP

public void setStoreTypeLDAP()
Set the storage type to a remote LDAP directory.

Since:
0.6.2008.06.23

setStoreTypeWebDAV

public void setStoreTypeWebDAV()
Set storage type to a remote WebDAV directory.

Since:
0.6.2008.06.23

getPolicyName

public java.lang.String getPolicyName()
Get the current policy name.

Returns:
the policy name.
Since:
0.6.2008.06.23

setPolicyName

public void setPolicyName(java.lang.String policyNameParam)
Set the current policy name.

Parameters:
policyNameParam - policy name.
Since:
0.6.2008.06.23

getLDAPACName

public java.lang.String getLDAPACName()
Get the LDAP attribute name for ACs. that are held in that particular directory.

Returns:
the AC attribute name.
Since:
0.6.2008.06.23

setLDAPACName

public void setLDAPACName(java.lang.String ldapACNameParam)
Set the LDAP attribute name for ACs. that are held in that particular directory.

Parameters:
ldapACNameParam - AC attribute name.
Since:
0.6.2008.06.23

getLDAPVersion

public java.lang.String getLDAPVersion()
Get the LDAP directory Version.

Returns:
the Version.
Since:
0.6.2008.06.23

setLDAPVersion

public void setLDAPVersion(java.lang.String ldapVersionParam)
Set the LDAP directory Version. that are held in that particular directory.

Parameters:
ldapVersionParam - Version.
Since:
0.6.2008.06.23

getHostStore

public java.lang.String getHostStore()
Get the LDAP or WebDAV host. where the policy is stored.

Returns:
host of where the policy is held.
Since:
0.6.2008.06.23

setHostStore

public void setHostStore(java.lang.String hostStoreParam)
Set the LDAP or WebDAV host. where the policy is stored.

Parameters:
hostStoreParam - host of where the policy is held.
Since:
0.6.2008.06.23

getPortStore

public java.lang.String getPortStore()
Get the LDAP or WebDAV port. where the policy is stored.

Returns:
port of where the policy is held.
Since:
0.6.2008.06.23

setPortStore

public void setPortStore(java.lang.String portStoreParam)
Set the LDAP or WebDAV port. where the policy is stored.

Parameters:
portStoreParam - port of where the policy is held.
Since:
0.6.2008.06.23

getCommunicationException

public PMException getCommunicationException()
get the last communication exception. This is the latest exception that was generated by PManager, to do with communication with the PERMIS agent. if there is one.

Returns:
the last communication exception.
Since:
0.6.2008.06.23

setCommunicationException

public void setCommunicationException(PMException communicationExceptionParam)
set the last communication exception. This is the latest exception that was generated by PManager, to do with communication with the PERMIS agent. if there is one.

Parameters:
communicationExceptionParam - the last communication exception.
Since:
0.6.2008.06.23

updatePolicy

public void updatePolicy()
                  throws PMException
Fire off the process that actually updates the PERMIS policy associated with the PERMIS agent. If it is in a file the policy is sent across the connection, if the policy exists in a remote directory (LDAP or WebDAV) then the managed PERMIS (which is connected to the PERMIS agent) will get the policy it self.

Throws:
PMException - - if the state is not right or the PERMIS agent reports a problem
Since:
0.6.2008.06.23

isUpdatingPolicy

public boolean isUpdatingPolicy()
get the updating policy flag. This flag is set to true in "updatePolicy" and false in "setUpdatePolicyResponse" and during that time the PERMIS manager "PManager" is sending and update policy request, and waiting for a response from the PERMIS agent.

Returns:
true if the policy is currently being updated.
Since:
0.6.2008.06.23

getUpdatePolicyResponse

public java.lang.String getUpdatePolicyResponse()
get the update policy response.

Returns:
the response.
Since:
0.6.2008.06.23

getName

public java.lang.String getName()
Get the cosmetic name that identifies the Reference to the PERMIS agent.

Returns:
the cosmetic name of that PERMIS agent
Since:
0.6.2008.06.19

setName

public void setName(java.lang.String value)
             throws PMException
Set the cosmetic name that identifies the reference to the PERMIS agent.

Parameters:
value - the cosmetic name assigned to the PERMIS agent
Throws:
PMException - if there is a problem with the name.
Since:
0.6.2008.06.19

getHost

public java.lang.String getHost()
Get the host name of where the PERMIS agent is located on the network.

Returns:
host location of the PERMIS agent
Since:
0.6.2008.06.19

setHost

public void setHost(java.lang.String value)
             throws PMException
Set the host name of where the PERMIS agent is located on the network.

Parameters:
value - host location of the PERMIS agent
Throws:
PMException - if there is a problem with the host
Since:
0.6.2008.06.19

getPort

public java.lang.String getPort()
Get the port number that the PERMIS agent is listening on.

Returns:
the port number that the PERMIS agent is listening on
Since:
0.6.2008.06.19

setPort

public void setPort(java.lang.String value)
             throws PMException
Set the port number that the PERMIS agent is listening on.

Parameters:
value - port number where the PERMIS agent is listening
Throws:
PMException - if there is a problem with the port number.
Since:
0.6.2008.06.19

getSSLSecureRandomNumberService

public java.lang.String getSSLSecureRandomNumberService()
Get the secure random number service.

Returns:
the secure random number service identifier
Since:
0.6.2008.06.19

setSSLSecureRandomNumberService

public void setSSLSecureRandomNumberService(java.lang.String value)
Set the secure random number service.

Parameters:
value - the secure random number service identifier
Since:
0.6.2008.06.19

getSSLSecureRandomNumberProvider

public java.lang.String getSSLSecureRandomNumberProvider()
Get the secure random number provider.

Returns:
value the secure random number provider identifier
Since:
0.6.2008.06.19

setSSLSecureRandomNumberProvider

public void setSSLSecureRandomNumberProvider(java.lang.String value)
Set the secure random number provider.

Parameters:
value - the secure random number provider identifer
Since:
0.6.2008.06.19

getSSLContextService

public java.lang.String getSSLContextService()
Get the SSL context service.

Returns:
the SSL context service identifier
Since:
0.6.2008.06.19

setSSLContextService

public void setSSLContextService(java.lang.String value)
Set the SSL context service.

Parameters:
value - the SSL context service identifier
Since:
0.6.2008.06.19

getSSLContextProvider

public java.lang.String getSSLContextProvider()
Get the SSL context provider.

Returns:
the SSL context provider identifier
Since:
0.6.2008.06.19

setSSLContextProvider

public void setSSLContextProvider(java.lang.String value)
Set the SSL context provider.

Parameters:
value - the SSL context provider
Since:
0.6.2008.06.19

getSSLEnabledProtocols

public java.lang.String getSSLEnabledProtocols()
Get the SSL enabled protocols.

Returns:
the SSL enabled protocol.
Since:
0.6.2008.06.19

setSSLEnabledProtocols

public void setSSLEnabledProtocols(java.lang.String value)
Set the SSL enabled protocols.

Parameters:
value - a space separated set of cipher suites
Since:
0.6.2008.06.19

getSSLEnabledCipherSuites

public java.lang.String getSSLEnabledCipherSuites()
Get the SSL enabled cipher suites.

Returns:
a space separated set of cipher suites
Since:
0.6.2008.06.19

setSSLEnabledCipherSuites

public void setSSLEnabledCipherSuites(java.lang.String value)
Set the SSL enabled cipher suites.

Parameters:
value - space separated set of cipher suites
Since:
0.6.2008.06.19