Package com.sas.services.information
Class RepositoryDef
java.lang.Object
com.sas.services.information.RepositoryDef
- All Implemented Interfaces:
ConsumedResourceInterface,Serializable,Cloneable
public class RepositoryDef
extends Object
implements Cloneable, ConsumedResourceInterface, 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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringXML element attribute describing the repository definition's auto-connect preference.static final StringXML element attribute describing the repository definition's base.static final StringXML element attribute describing the repository definition's description.static final StringXML element attribute describing the repository definition's domain.static final StringXML element attribute describing the hibernate dialect of the repository.static final StringXML element attribute describing the repository definition's host.static final StringXML element attribute describing the repository definition's secure status.static final StringXML element attribute describing the repository definition's name.static final StringXML element attribute describing the repository definition's port number.static final StringXML element attribute describing the repository definition's protocol.static final StringXML element attribute describing the repository definition's proxy URL.static final StringXML element attribute describing the repository definition's unique id.static final StringXML element name for a repository definition.static final StringPropertyChangeEvent property name signifying a change in the repository definition's auto connect preference.static final StringPropertyChangeEvent property name signifying a change in the repository definition's base.static final StringPropertyChangeEvent property name signifying a change in the repository definition's description.static final StringPropertyChangeEvent property name signifying a change in the repository definition's domain.static final Stringproperty name of the hibernate dialect.static final StringPropertyChangeEvent property name signifying a change in the repository definition's host.static final StringPropertyChangeEvent property name signifying a change in the definition's secure status.static final StringPropertyChangeEvent property name signifying a change in the repository definition's name.static final StringPropertyChangeEvent property name signifying a change in the repository definition's port.static final StringPropertyChangeEvent property name signifying a change in the repository protocol.static final StringPropertyChangeEvent property name signifying a change in the repository definition's proxy string. -
Constructor Summary
ConstructorsConstructorDescriptionRepositoryDef(String host, String port, String domain) Construct a new RepositoryDef with a host, port and domain.RepositoryDef(String host, String port, String domain, String base) Construct a new RepositoryDef with a host, port, domain and base.RepositoryDef(String host, String port, String domain, String base, String protocol) Construct a new RepositoryDef.RepositoryDef(String host, String port, String domain, String base, String protocol, String name) Construct a new RepositoryDef.RepositoryDef(String uid, String host, String port, String domain, String base, String protocol, String name) Construct a new RepositoryDef. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAdvancedOptions(String key, String value) voidaddHibClass(String className) Objectclone()Clones this RepositoryDef.final booleanequals(Object obj) Indicates whether some other object is "equal to" this one.MapbooleangetAuto()Get the flag which indicates whether this definition represents a connection that should be made automatically.StringgetBase()Get the search base for this server.StringGet the description for this definition.StringGet the authentication domain name for this server.Listfinal StringStringgetHost()Get the IP hostname where the server is running.booleanGet the secure connection flag for this definition.StringGets a localized value describing the resource's type.StringGets a localized value describing the resource's type and value.StringgetName()Get the name for this definition.MapGet the connection information as a Map object.StringgetPort()Get the IP port the server is listening on.StringGet the application protocol for this server.StringgetProxy()Get the proxy URL for this repository definition.StringGets the id that uniquely identifies the resource within a service's configuration.StringGets a value describing the resource's type.intGets the code describing the resource's type.StringGets the value used to identify the service configuration resource.StringgetUrl()Get a URL that represents this definition.final inthashCode()Gets a hash code based upon this object's attributes.booleanDetermines if this resource is required by the service's configuration.voidremoveHibClass(String className) voidsetAdvancedOptions(Map options) voidsetAuto(boolean auto) Set whether this definition represents a connection which should be made automatically.voidsetBase(String base) Set the search base for this server.voidsetDescription(String description) Set the description for this definition.voidsetDomain(String domain) Set the authentication domain name for this server.voidsetHibClasses(List classnames) final voidsetHibDialect(String dialect) voidsetHost(String host) Set the IP host name for the host where the server is running.voidsetIsSecure(boolean secure) Set the secure connection flag for this definition.voidsetName(String name) Set the name for this definition.voidsetPort(String port) Set the IP port the server is listening on.voidsetProtocol(String protocol) Set the application protocol for this server.voidsetProxy(String proxy) Set the proxy string for this repository definition.StringtoString()Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
ELEMENT_NAME
public static final String ELEMENT_NAMEXML element name for a repository definition.- See Also:
-
ATTRIBUTE_UID
public static final String ATTRIBUTE_UIDXML element attribute describing the repository definition's unique id.- See Also:
-
ATTRIBUTE_NAME
public static final String ATTRIBUTE_NAMEXML element attribute describing the repository definition's name.- See Also:
-
ATTRIBUTE_HOST
public static final String ATTRIBUTE_HOSTXML element attribute describing the repository definition's host.- See Also:
-
ATTRIBUTE_PORT
public static final String ATTRIBUTE_PORTXML element attribute describing the repository definition's port number.- See Also:
-
ATTRIBUTE_AUTOCONNECT
public static final String ATTRIBUTE_AUTOCONNECTXML element attribute describing the repository definition's auto-connect preference.- See Also:
-
ATTRIBUTE_BASE
public static final String ATTRIBUTE_BASEXML element attribute describing the repository definition's base.- See Also:
-
ATTRIBUTE_DESCRIPTION
public static final String ATTRIBUTE_DESCRIPTIONXML element attribute describing the repository definition's description.- See Also:
-
ATTRIBUTE_DOMAIN
public static final String ATTRIBUTE_DOMAINXML element attribute describing the repository definition's domain.- See Also:
-
ATTRIBUTE_PROTOCOL
public static final String ATTRIBUTE_PROTOCOLXML element attribute describing the repository definition's protocol.- See Also:
-
ATTRIBUTE_PROXY
public static final String ATTRIBUTE_PROXYXML element attribute describing the repository definition's proxy URL.- See Also:
-
ATTRIBUTE_ISSECURE
public static final String ATTRIBUTE_ISSECUREXML element attribute describing the repository definition's secure status.- See Also:
-
ATTRIBUTE_HIBDIALECT
public static final String ATTRIBUTE_HIBDIALECTXML element attribute describing the hibernate dialect of the repository.- See Also:
-
PROPERTYNAME_PROTOCOL
public static final String PROPERTYNAME_PROTOCOLPropertyChangeEvent property name signifying a change in the repository protocol.- See Also:
-
PROPERTYNAME_NAME
public static final String PROPERTYNAME_NAMEPropertyChangeEvent property name signifying a change in the repository definition's name.- See Also:
-
PROPERTYNAME_DESCRIPTION
public static final String PROPERTYNAME_DESCRIPTIONPropertyChangeEvent property name signifying a change in the repository definition's description.- See Also:
-
PROPERTYNAME_HOST
public static final String PROPERTYNAME_HOSTPropertyChangeEvent property name signifying a change in the repository definition's host.- See Also:
-
PROPERTYNAME_PORT
public static final String PROPERTYNAME_PORTPropertyChangeEvent property name signifying a change in the repository definition's port.- See Also:
-
PROPERTYNAME_BASE
public static final String PROPERTYNAME_BASEPropertyChangeEvent property name signifying a change in the repository definition's base.- See Also:
-
PROPERTYNAME_DOMAIN
public static final String PROPERTYNAME_DOMAINPropertyChangeEvent property name signifying a change in the repository definition's domain.- See Also:
-
PROPERTYNAME_AUTOCONNECT
public static final String PROPERTYNAME_AUTOCONNECTPropertyChangeEvent property name signifying a change in the repository definition's auto connect preference.- See Also:
-
PROPERTYNAME_PROXY
public static final String PROPERTYNAME_PROXYPropertyChangeEvent property name signifying a change in the repository definition's proxy string.- See Also:
-
PROPERTYNAME_ISSECURE
public static final String PROPERTYNAME_ISSECUREPropertyChangeEvent property name signifying a change in the definition's secure status.- See Also:
-
PROPERTYNAME_HIBDIALECT
public static final String PROPERTYNAME_HIBDIALECTproperty name of the hibernate dialect.- See Also:
-
-
Constructor Details
-
RepositoryDef
public RepositoryDef(String host, String port, 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(String host, String port, String domain, 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(String host, String port, String domain, String base, 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(String host, String port, String domain, String base, String protocol, 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(String uid, String host, String port, String domain, String base, String protocol, 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 Details
-
toString
public String toString()- Overrides:
toStringin classObject
-
getOptions
public 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 String getUrl()Get a URL that represents this definition.- Returns:
- a
Stringvalue that represents this repository definition.
-
setHost
public void setHost(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 String getHost()Get the IP hostname where the server is running.- Returns:
- The host name where the server is running.
-
setPort
public void setPort(String port) Set the IP port the server is listening on.- Parameters:
port- The IP port the repository server is listening on.
-
getPort
public 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(String domain) Set the authentication domain name for this server.- Parameters:
domain- The authentication domain the server uses to authenticate users.
-
getDomain
public String getDomain()Get the authentication domain name for this server.- Returns:
- The authentication domain the server uses for authenticating users.
-
setBase
public void setBase(String base) Set the search base for this server.- Parameters:
base- AStringthat 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 String getBase()Get the search base for this server.- Returns:
- The search base string.
-
setProtocol
public void setProtocol(String protocol) Set the application protocol for this server.- Parameters:
protocol- The protocol for this server (ldap, omi, dav).
-
getProtocol
public String getProtocol()Get the application protocol for this server.- Returns:
- The protocol for this server (ldap, omi, dav).
-
setDescription
public void setDescription(String description) Set the description for this definition.- Parameters:
description- A string describing the repository represented by this definition.
-
getDescription
public String getDescription()Get the description for this definition.- Returns:
- A string describing the repository represented by this definition.
-
setName
public void setName(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 String getName()Get the name for this definition.- Returns:
- The name string for this repository.
-
setProxy
public void setProxy(String proxy) Set the proxy string for this repository definition.- Parameters:
proxy- The proxy URL.
-
getProxy
public 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(Object obj) Indicates whether some other object is "equal to" this one. The other object is equivalent if all of the following are equivalent- base
- domain
- host
- name
- description
- proxy
- protocol
- port
- security preference
- auto-connect preference
- Overrides:
equalsin classObject- Parameters:
obj- the reference object with which to compare.- Returns:
trueif this object is the same as the obj argument;falseotherwise.- See Also:
-
hashCode
public final int hashCode()Gets a hash code based upon this object's attributes.- Overrides:
hashCodein classObject- Returns:
- Hash code.
-
setAdvancedOptions
public void setAdvancedOptions(Map options) -
addAdvancedOptions
public void addAdvancedOptions(String key, String value) -
getAdvancedOptions
public Map getAdvancedOptions() -
getHibDialect
public final String getHibDialect() -
setHibDialect
public final void setHibDialect(String dialect) -
getHibClasses
public List getHibClasses() -
addHibClass
public void addHibClass(String className) -
removeHibClass
public void removeHibClass(String className) -
setHibClasses
public void setHibClasses(List classnames) -
clone
public Object clone() throws CloneNotSupportedExceptionClones this RepositoryDef.- Specified by:
clonein interfaceConsumedResourceInterface- Overrides:
clonein classObject- Returns:
- Clone of this RepositoryDef.
- Throws:
CloneNotSupportedException
-
cloneConfig
-
getResourceID
public String getResourceID()Description copied from interface:ConsumedResourceInterfaceGets the id that uniquely identifies the resource within a service's configuration.- Specified by:
getResourceIDin interfaceConsumedResourceInterface- Returns:
- Resource's ID.
-
getResourceValue
public String getResourceValue()Description copied from interface:ConsumedResourceInterfaceGets the value used to identify the service configuration resource.- Specified by:
getResourceValuein interfaceConsumedResourceInterface- Returns:
- Service configuration resource's value.
-
getLocalizedResourceType
public String getLocalizedResourceType()Description copied from interface:ConsumedResourceInterfaceGets a localized value describing the resource's type.- Specified by:
getLocalizedResourceTypein interfaceConsumedResourceInterface- Returns:
- Resource's type. For example, a Logging Service configuration's resource types would be localized values for "Context", "Output", and "Renderer".
-
getLocalizedResourceTypeAndValue
public String getLocalizedResourceTypeAndValue()Description copied from interface:ConsumedResourceInterfaceGets a localized value describing the resource's type and value.- Specified by:
getLocalizedResourceTypeAndValuein interfaceConsumedResourceInterface- 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 String getResourceType()Description copied from interface:ConsumedResourceInterfaceGets a value describing the resource's type.- Specified by:
getResourceTypein interfaceConsumedResourceInterface- 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:ConsumedResourceInterfaceGets the code describing the resource's type.- Specified by:
getResourceTypeCodein interfaceConsumedResourceInterface- Returns:
- Resource's type code.
-
isRequired
public boolean isRequired()Description copied from interface:ConsumedResourceInterfaceDetermines if this resource is required by the service's configuration.- Specified by:
isRequiredin interfaceConsumedResourceInterface- Returns:
trueif this resource is required by the service's configuration.
-