com.sas.services.information
Class RepositoryDef

com.sas.services.information.RepositoryDef
All Implemented Interfaces:
ConsumedResourceInterface, java.io.Serializable, java.lang.Cloneable

public class RepositoryDef
implements java.lang.Cloneable, ConsumedResourceInterface, java.io.Serializable

This class holds a definition for a repository connection. Using this information, a user can call the InformationService.connect() method to establish a connection to a repository. Objects of this type are returned from the InformationService.getReposDefs and InformationService.findServers methods.

Since:
1.0
See Also:
Serialized Form

Field Summary
static java.lang.String ATTRIBUTE_AUTOCONNECT
          XML element attribute describing the repository definition's auto-connect preference.
static java.lang.String ATTRIBUTE_BASE
          XML element attribute describing the repository definition's base.
static java.lang.String ATTRIBUTE_DESCRIPTION
          XML element attribute describing the repository definition's description.
static java.lang.String ATTRIBUTE_DOMAIN
          XML element attribute describing the repository definition's domain.
static java.lang.String ATTRIBUTE_HIBDIALECT
          XML element attribute describing the hibernate dialect of the repository.
static java.lang.String ATTRIBUTE_HOST
          XML element attribute describing the repository definition's host.
static java.lang.String ATTRIBUTE_ISSECURE
          XML element attribute describing the repository definition's secure status.
static java.lang.String ATTRIBUTE_NAME
          XML element attribute describing the repository definition's name.
static java.lang.String ATTRIBUTE_PORT
          XML element attribute describing the repository definition's port number.
static java.lang.String ATTRIBUTE_PROTOCOL
          XML element attribute describing the repository definition's protocol.
static java.lang.String ATTRIBUTE_PROXY
          XML element attribute describing the repository definition's proxy URL.
static java.lang.String ATTRIBUTE_UID
          XML element attribute describing the repository definition's unique id.
static java.lang.String ELEMENT_NAME
          XML element name for a repository definition.
static java.lang.String PROPERTYNAME_AUTOCONNECT
          PropertyChangeEvent property name signifying a change in the repository definition's auto connect preference.
static java.lang.String PROPERTYNAME_BASE
          PropertyChangeEvent property name signifying a change in the repository definition's base.
static java.lang.String PROPERTYNAME_DESCRIPTION
          PropertyChangeEvent property name signifying a change in the repository definition's description.
static java.lang.String PROPERTYNAME_DOMAIN
          PropertyChangeEvent property name signifying a change in the repository definition's domain.
static java.lang.String PROPERTYNAME_HIBDIALECT
          property name of the hibernate dialect.
static java.lang.String PROPERTYNAME_HOST
          PropertyChangeEvent property name signifying a change in the repository definition's host.
static java.lang.String PROPERTYNAME_ISSECURE
          PropertyChangeEvent property name signifying a change in the definition's secure status.
static java.lang.String PROPERTYNAME_NAME
          PropertyChangeEvent property name signifying a change in the repository definition's name.
static java.lang.String PROPERTYNAME_PORT
          PropertyChangeEvent property name signifying a change in the repository definition's port.
static java.lang.String PROPERTYNAME_PROTOCOL
          PropertyChangeEvent property name signifying a change in the repository protocol.
static java.lang.String PROPERTYNAME_PROXY
          PropertyChangeEvent property name signifying a change in the repository definition's proxy string.
 
Constructor Summary
RepositoryDef(java.lang.String host, java.lang.String port, java.lang.String domain)
          Construct a new RepositoryDef with a host, port and domain.
RepositoryDef(java.lang.String host, java.lang.String port, java.lang.String domain, java.lang.String base)
          Construct a new RepositoryDef with a host, port, domain and base.
RepositoryDef(java.lang.String host, java.lang.String port, java.lang.String domain, java.lang.String base, java.lang.String protocol)
          Construct a new RepositoryDef.
RepositoryDef(java.lang.String host, java.lang.String port, java.lang.String domain, java.lang.String base, java.lang.String protocol, java.lang.String name)
          Construct a new RepositoryDef.
RepositoryDef(java.lang.String uid, java.lang.String host, java.lang.String port, java.lang.String domain, java.lang.String base, java.lang.String protocol, java.lang.String name)
          Construct a new RepositoryDef.
 
Method Summary
 void addAdvancedOptions(java.lang.String key, java.lang.String value)
           
 void addHibClass(java.lang.String className)
           
 java.lang.Object clone()
          Clones this RepositoryDef.
 RepositoryDef cloneConfig()
           
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 java.util.Map getAdvancedOptions()
           
 boolean getAuto()
          Get the flag which indicates whether this definition represents a connection that should be made automatically.
 java.lang.String getBase()
          Get the search base for this server.
 java.lang.String getDescription()
          Get the description for this definition.
 java.lang.String getDomain()
          Get the authentication domain name for this server.
 java.util.List getHibClasses()
           
 java.lang.String getHibDialect()
           
 java.lang.String getHost()
          Get the IP hostname where the server is running.
 boolean getIsSecure()
          Get the secure connection flag for this definition.
 java.lang.String getLocalizedResourceType()
          Gets a localized value describing the resource's type.
 java.lang.String getLocalizedResourceTypeAndValue()
          Gets a localized value describing the resource's type and value.
 java.lang.String getName()
          Get the name for this definition.
 java.util.Map getOptions()
          Get the connection information as a Map object.
 java.lang.String getPort()
          Get the IP port the server is listening on.
 java.lang.String getProtocol()
          Get the application protocol for this server.
 java.lang.String getProxy()
          Get the proxy URL for this repository definition.
 java.lang.String getResourceID()
          Gets the id that uniquely identifies the resource within a service's configuration.
 java.lang.String getResourceType()
          Gets a value describing the resource's type.
 int getResourceTypeCode()
          Gets the code describing the resource's type.
 java.lang.String getResourceValue()
          Gets the value used to identify the service configuration resource.
 java.lang.String getUrl()
          Get a URL that represents this definition.
 int hashCode()
          Gets a hash code based upon this object's attributes.
 boolean isRequired()
          Determines if this resource is required by the service's configuration.
 void removeHibClass(java.lang.String className)
           
 void setAdvancedOptions(java.util.Map options)
           
 void setAuto(boolean auto)
          Set whether this definition represents a connection which should be made automatically.
 void setBase(java.lang.String base)
          Set the search base for this server.
 void setDescription(java.lang.String description)
          Set the description for this definition.
 void setDomain(java.lang.String domain)
          Set the authentication domain name for this server.
 void setHibClasses(java.util.List classnames)
           
 void setHibDialect(java.lang.String dialect)
           
 void setHost(java.lang.String host)
          Set the IP host name for the host where the server is running.
 void setIsSecure(boolean secure)
          Set the secure connection flag for this definition.
 void setName(java.lang.String name)
          Set the name for this definition.
 void setPort(java.lang.String port)
          Set the IP port the server is listening on.
 void setProtocol(java.lang.String protocol)
          Set the application protocol for this server.
 void setProxy(java.lang.String proxy)
          Set the proxy string for this repository definition.
 java.lang.String toString()
           
 

Field Detail

ELEMENT_NAME

public static final java.lang.String ELEMENT_NAME
XML element name for a repository definition.

See Also:
Constant Field Values

ATTRIBUTE_UID

public static final java.lang.String ATTRIBUTE_UID
XML element attribute describing the repository definition's unique id.

See Also:
Constant Field Values

ATTRIBUTE_NAME

public static final java.lang.String ATTRIBUTE_NAME
XML element attribute describing the repository definition's name.

See Also:
Constant Field Values

ATTRIBUTE_HOST

public static final java.lang.String ATTRIBUTE_HOST
XML element attribute describing the repository definition's host.

See Also:
Constant Field Values

ATTRIBUTE_PORT

public static final java.lang.String ATTRIBUTE_PORT
XML element attribute describing the repository definition's port number.

See Also:
Constant Field Values

ATTRIBUTE_AUTOCONNECT

public static final java.lang.String ATTRIBUTE_AUTOCONNECT
XML element attribute describing the repository definition's auto-connect preference.

See Also:
Constant Field Values

ATTRIBUTE_BASE

public static final java.lang.String ATTRIBUTE_BASE
XML element attribute describing the repository definition's base.

See Also:
Constant Field Values

ATTRIBUTE_DESCRIPTION

public static final java.lang.String ATTRIBUTE_DESCRIPTION
XML element attribute describing the repository definition's description.

See Also:
Constant Field Values

ATTRIBUTE_DOMAIN

public static final java.lang.String ATTRIBUTE_DOMAIN
XML element attribute describing the repository definition's domain.

See Also:
Constant Field Values

ATTRIBUTE_PROTOCOL

public static final java.lang.String ATTRIBUTE_PROTOCOL
XML element attribute describing the repository definition's protocol.

See Also:
Constant Field Values

ATTRIBUTE_PROXY

public static final java.lang.String ATTRIBUTE_PROXY
XML element attribute describing the repository definition's proxy URL.

See Also:
Constant Field Values

ATTRIBUTE_ISSECURE

public static final java.lang.String ATTRIBUTE_ISSECURE
XML element attribute describing the repository definition's secure status.

See Also:
Constant Field Values

ATTRIBUTE_HIBDIALECT

public static final java.lang.String ATTRIBUTE_HIBDIALECT
XML element attribute describing the hibernate dialect of the repository.

See Also:
Constant Field Values

PROPERTYNAME_PROTOCOL

public static final java.lang.String PROPERTYNAME_PROTOCOL
PropertyChangeEvent property name signifying a change in the repository protocol.

See Also:
Constant Field Values

PROPERTYNAME_NAME

public static final java.lang.String PROPERTYNAME_NAME
PropertyChangeEvent property name signifying a change in the repository definition's name.

See Also:
Constant Field Values

PROPERTYNAME_DESCRIPTION

public static final java.lang.String PROPERTYNAME_DESCRIPTION
PropertyChangeEvent property name signifying a change in the repository definition's description.

See Also:
Constant Field Values

PROPERTYNAME_HOST

public static final java.lang.String PROPERTYNAME_HOST
PropertyChangeEvent property name signifying a change in the repository definition's host.

See Also:
Constant Field Values

PROPERTYNAME_PORT

public static final java.lang.String PROPERTYNAME_PORT
PropertyChangeEvent property name signifying a change in the repository definition's port.

See Also:
Constant Field Values

PROPERTYNAME_BASE

public static final java.lang.String PROPERTYNAME_BASE
PropertyChangeEvent property name signifying a change in the repository definition's base.

See Also:
Constant Field Values

PROPERTYNAME_DOMAIN

public static final java.lang.String PROPERTYNAME_DOMAIN
PropertyChangeEvent property name signifying a change in the repository definition's domain.

See Also:
Constant Field Values

PROPERTYNAME_AUTOCONNECT

public static final java.lang.String PROPERTYNAME_AUTOCONNECT
PropertyChangeEvent property name signifying a change in the repository definition's auto connect preference.

See Also:
Constant Field Values

PROPERTYNAME_PROXY

public static final java.lang.String PROPERTYNAME_PROXY
PropertyChangeEvent property name signifying a change in the repository definition's proxy string.

See Also:
Constant Field Values

PROPERTYNAME_ISSECURE

public static final java.lang.String PROPERTYNAME_ISSECURE
PropertyChangeEvent property name signifying a change in the definition's secure status.

See Also:
Constant Field Values

PROPERTYNAME_HIBDIALECT

public static final java.lang.String PROPERTYNAME_HIBDIALECT
property name of the hibernate dialect.

See Also:
Constant Field Values
Constructor Detail

RepositoryDef

public RepositoryDef(java.lang.String host,
                     java.lang.String port,
                     java.lang.String domain)
Construct a new RepositoryDef with a host, port and domain. If this is used, a separate call to setProtocol at least will be required.

Parameters:
host - The IP host name where the server is running.
port - The IP port the server is listening on.
domain - The authentication domain for looking up credentials.

RepositoryDef

public RepositoryDef(java.lang.String host,
                     java.lang.String port,
                     java.lang.String domain,
                     java.lang.String base)
Construct a new RepositoryDef with a host, port, domain and base.

Parameters:
host - The IP host name where the server is running.
port - The IP port the server is listening on.
domain - The authentication domain for looking up credentials.
base - A base location for searches. This will be repository-specific. For LDAP repositories, it will be a DN. For OMR, a repository name. While a base isn't required, it's strongly recommended.

RepositoryDef

public RepositoryDef(java.lang.String host,
                     java.lang.String port,
                     java.lang.String domain,
                     java.lang.String base,
                     java.lang.String protocol)
Construct a new RepositoryDef.

Parameters:
host - The IP host name where the server is running.
port - The IP port the server is listening on.
domain - The authentication domain for looking up credentials.
base - A base location for searches. This will be repository-specific. For LDAP repositories, it will be a DN. For OMR, a repository name. While a base isn't required, it's strongly recommended.
protocol - The application protocol for the repository. For Ldap, "ldap", for OMR, "omi", for DAV, "dav".

RepositoryDef

public RepositoryDef(java.lang.String host,
                     java.lang.String port,
                     java.lang.String domain,
                     java.lang.String base,
                     java.lang.String protocol,
                     java.lang.String name)
Construct a new RepositoryDef.

Parameters:
host - The IP host name where the server is running.
port - The IP port the server is listening on.
domain - The authentication domain for looking up credentials.
base - A base location for searches. This will be repository-specific. For LDAP repositories, it will be a DN. For OMR, a repository name. While a base isn't required, it's strongly recommended.
protocol - The application protocol for the repository. For LDAP, "ldap", for OMR, "omi", for DAV, "dav".
name - Repository def's name. Used as an internal key for a hash map.

RepositoryDef

public RepositoryDef(java.lang.String uid,
                     java.lang.String host,
                     java.lang.String port,
                     java.lang.String domain,
                     java.lang.String base,
                     java.lang.String protocol,
                     java.lang.String name)
Construct a new RepositoryDef.

Parameters:
uid - Unique identifier.
host - The IP host name where the server is running.
port - The IP port the server is listening on.
domain - The authentication domain for looking up credentials.
base - A base location for searches. This will be repository-specific. For LDAP repositories, it will be a DN. For OMR, a repository name. While a base isn't required, it's strongly recommended.
protocol - The application protocol for the repository. For LDAP, "ldap", for OMR, "omi", for DAV, "dav".
name - Repository def's name. Used as an internal key for a hash map.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getOptions

public java.util.Map getOptions()
Get the connection information as a Map object.

Returns:
The Map of options for this definition.

setAuto

public void setAuto(boolean auto)
Set whether this definition represents a connection which should be made automatically.

Parameters:
auto - A flag indicating whether the repository this definition represents should be connected to automatically.

getAuto

public boolean getAuto()
Get the flag which indicates whether this definition represents a connection that should be made automatically.

Returns:
A flag indicating if this repository should be connected to automatically when a user logs in. This flag is only meaningful when set in the InformationService configuration.

getUrl

public java.lang.String getUrl()
Get a URL that represents this definition.

Returns:
a String value that represents this repository definition.

setHost

public void setHost(java.lang.String host)
Set the IP host name for the host where the server is running.

Parameters:
host - The host the repository server is running on.

getHost

public java.lang.String getHost()
Get the IP hostname where the server is running.

Returns:
The host name where the server is running.

setPort

public void setPort(java.lang.String port)
Set the IP port the server is listening on.

Parameters:
port - The IP port the repository server is listening on.

getPort

public java.lang.String getPort()
Get the IP port the server is listening on.

Returns:
The IP port the repository server is listening on.

setDomain

public void setDomain(java.lang.String domain)
Set the authentication domain name for this server.

Parameters:
domain - The authentication domain the server uses to authenticate users.

getDomain

public java.lang.String getDomain()
Get the authentication domain name for this server.

Returns:
The authentication domain the server uses for authenticating users.

setBase

public void setBase(java.lang.String base)
Set the search base for this server.

Parameters:
base - A String that represents the base for searches in the repository. This string will be repository specific (A DN in LDAP, a repository ID in OMR).

getBase

public java.lang.String getBase()
Get the search base for this server.

Returns:
The search base string.

setProtocol

public void setProtocol(java.lang.String protocol)
Set the application protocol for this server.

Parameters:
protocol - The protocol for this server (ldap, omi, dav).

getProtocol

public java.lang.String getProtocol()
Get the application protocol for this server.

Returns:
The protocol for this server (ldap, omi, dav).

setDescription

public void setDescription(java.lang.String description)
Set the description for this definition.

Parameters:
description - A string describing the repository represented by this definition.

getDescription

public java.lang.String getDescription()
Get the description for this definition.

Returns:
A string describing the repository represented by this definition.

setName

public void setName(java.lang.String name)
Set the name for this definition.

Parameters:
name - A name for this definition. The name is really only useful for definitions contained in the InformationService configuration.

getName

public java.lang.String getName()
Get the name for this definition.

Returns:
The name string for this repository.

setProxy

public void setProxy(java.lang.String proxy)
Set the proxy string for this repository definition.

Parameters:
proxy - The proxy URL.

getProxy

public java.lang.String getProxy()
Get the proxy URL for this repository definition.

Returns:
The proxy URL as a string.

setIsSecure

public void setIsSecure(boolean secure)
Set the secure connection flag for this definition.

Parameters:
secure - True if a secure connection is to be used for this repository.

getIsSecure

public boolean getIsSecure()
Get the secure connection flag for this definition.

Returns:
true if a secure connection should be used for this repository.

equals

public final boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. The other object is equivalent if all of the following are equivalent

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
hashCode(), Hashtable

hashCode

public final int hashCode()
Gets a hash code based upon this object's attributes.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code.

setAdvancedOptions

public void setAdvancedOptions(java.util.Map options)

addAdvancedOptions

public void addAdvancedOptions(java.lang.String key,
                               java.lang.String value)

getAdvancedOptions

public java.util.Map getAdvancedOptions()

getHibDialect

public final java.lang.String getHibDialect()

setHibDialect

public final void setHibDialect(java.lang.String dialect)

getHibClasses

public java.util.List getHibClasses()

addHibClass

public void addHibClass(java.lang.String className)

removeHibClass

public void removeHibClass(java.lang.String className)

setHibClasses

public void setHibClasses(java.util.List classnames)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones this RepositoryDef.

Specified by:
clone in interface ConsumedResourceInterface
Overrides:
clone in class java.lang.Object
Returns:
Clone of this RepositoryDef.
Throws:
java.lang.CloneNotSupportedException

cloneConfig

public RepositoryDef cloneConfig()

getResourceID

public java.lang.String getResourceID()
Description copied from interface: ConsumedResourceInterface
Gets the id that uniquely identifies the resource within a service's configuration.

Specified by:
getResourceID in interface ConsumedResourceInterface
Returns:
Resource's ID.

getResourceValue

public java.lang.String getResourceValue()
Description copied from interface: ConsumedResourceInterface
Gets the value used to identify the service configuration resource.

Specified by:
getResourceValue in interface ConsumedResourceInterface
Returns:
Service configuration resource's value.

getLocalizedResourceType

public java.lang.String getLocalizedResourceType()
Description copied from interface: ConsumedResourceInterface
Gets a localized value describing the resource's type.

Specified by:
getLocalizedResourceType in interface ConsumedResourceInterface
Returns:
Resource's type. For example, a Logging Service configuration's resource types would be localized values for "Context", "Output", and "Renderer".

getLocalizedResourceTypeAndValue

public java.lang.String getLocalizedResourceTypeAndValue()
Description copied from interface: ConsumedResourceInterface
Gets a localized value describing the resource's type and value.

Specified by:
getLocalizedResourceTypeAndValue in interface ConsumedResourceInterface
Returns:
Resource's type. For example, a Logging Service configuration's resource types would be localized values for
  • "Context : com.sas.services"
  • "Output : A1"
  • "Renderer: com.sas.MyRenderer"

getResourceType

public java.lang.String getResourceType()
Description copied from interface: ConsumedResourceInterface
Gets a value describing the resource's type.

Specified by:
getResourceType in interface ConsumedResourceInterface
Returns:
Resource's type. For example, a Logging Service configuration's resource types would be "Context", "Output", and "Renderer".

getResourceTypeCode

public int getResourceTypeCode()
Description copied from interface: ConsumedResourceInterface
Gets the code describing the resource's type.

Specified by:
getResourceTypeCode in interface ConsumedResourceInterface
Returns:
Resource's type code.

isRequired

public boolean isRequired()
Description copied from interface: ConsumedResourceInterface
Determines if this resource is required by the service's configuration.

Specified by:
isRequired in interface ConsumedResourceInterface
Returns:
true if this resource is required by the service's configuration.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.