org.jboss.example.dna.repository
Class RepositoryClient

java.lang.Object
  extended by org.jboss.example.dna.repository.RepositoryClient

public class RepositoryClient
extends Object

Author:
Randall Hauch

Nested Class Summary
static class RepositoryClient.Api
           
 
Field Summary
static String INMEMORY_REPOSITORY_SOURCE_CLASSNAME
           
static String JAAS_LOGIN_CONTEXT_NAME
           
 
Constructor Summary
RepositoryClient()
           
 
Method Summary
 List<String> getNamesOfRepositories()
          Get the names of the repositories.
 boolean getNodeInfo(String sourceName, String pathToNode, Map<String,Object[]> properties, List<String> children)
          Get the information about a node, using the API method.
 void logout()
          Calling this will lose the context
static void main(String[] args)
           
 void setApi(RepositoryClient.Api api)
          Set the API that this client should use to interact with the repositories.
 void setJaasContextName(String jaasContextName)
          Set the JAAS context name that should be used.
 void setUserInterface(UserInterface userInterface)
           
 void shutdown()
          Shut down the components and services and blocking until all resources have been released.
 void startRepositories()
          Start up the repositories.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INMEMORY_REPOSITORY_SOURCE_CLASSNAME

public static final String INMEMORY_REPOSITORY_SOURCE_CLASSNAME
See Also:
Constant Field Values

JAAS_LOGIN_CONTEXT_NAME

public static final String JAAS_LOGIN_CONTEXT_NAME
See Also:
Constant Field Values
Constructor Detail

RepositoryClient

public RepositoryClient()
Method Detail

main

public static void main(String[] args)
Parameters:
args -

setUserInterface

public void setUserInterface(UserInterface userInterface)
Parameters:
userInterface - Sets userInterface to the specified value.

setApi

public void setApi(RepositoryClient.Api api)
Set the API that this client should use to interact with the repositories.

Parameters:
api - The API that should be used

setJaasContextName

public void setJaasContextName(String jaasContextName)
Set the JAAS context name that should be used. If null (which is the default), then no authentication will be used.

Parameters:
jaasContextName - the JAAS context name, or null if no authentication should be performed

startRepositories

public void startRepositories()
                       throws IOException,
                              SAXException,
                              NamingException
Start up the repositories. This method creates the necessary components and services, and initializes the in-memory repositories.

Throws:
IOException - if there is a problem initializing the repositories from the files.
SAXException - if there is a problem with the SAX Parser
NamingException - if there is a problem registering or looking up objects in JNDI

getNamesOfRepositories

public List<String> getNamesOfRepositories()
Get the names of the repositories.

Returns:
the repository names

shutdown

public void shutdown()
              throws InterruptedException,
                     LoginException
Shut down the components and services and blocking until all resources have been released.

Throws:
InterruptedException - if the thread was interrupted before completing the shutdown.
LoginException

logout

public void logout()
            throws LoginException
Calling this will lose the context

Throws:
LoginException

getNodeInfo

public boolean getNodeInfo(String sourceName,
                           String pathToNode,
                           Map<String,Object[]> properties,
                           List<String> children)
                    throws Throwable
Get the information about a node, using the API method.

Parameters:
sourceName - the name of the repository source
pathToNode - the path to the node in the repository that is to be retrieved
properties - the map into which the property values will be placed; may be null if the properties are not to be retrieved
children - the collection into which the child names should be placed; may be null if the children are not to be retrieved
Returns:
true if the node was found, or false if it was not
Throws:
Throwable


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.