|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.ndr.toolkit.NDRToolkit
public class NDRToolkit
Class for interacting with the NDRToolkit (sorry about the name confusion!).
Initialized using an Agent Identity obtained from NDRConstants
(see getNdrAccess method) NOTE: methods that change an objects state should
return a HANDLE and not the OBJECT, since the object will not reflect it's
actaul state anymore!!
Constructor Summary | |
---|---|
NDRToolkit()
Constructor for the ToolKit object |
Method Summary | |
---|---|
void |
findNsdlOrgAggregators()
Find the aggregators corresponding to NSDL.org collections |
org.nsdl.repository.model.types.Resource |
findResource(String url)
Find a resource object for the provided url. |
org.nsdl.repository.model.types.Agent |
getAgent()
Gets the agent attribute of the ToolKit object |
org.nsdl.repository.model.types.Aggregator |
getAggregator(String handle)
Gets the aggregator attribute of the NDRToolkit object |
void |
getAllResources()
Find ALL resources in the NDR |
org.nsdl.repository.access.Finder |
getFinder()
Obtains a Finder instance |
org.nsdl.repository.model.types.MetadataProvider |
getMetadataProvider(String handle)
Obtain a MetadataProvider object for provided handle |
org.nsdl.repository.access.NDRAccess |
getNdrAccess()
Instantiates a Client instance, configures the client properties to enable it to authenticate with the NDR, and finally obtains access from the client. |
org.nsdl.repository.model.types.Resource |
getResource(String handle)
Gets the resource instance from the NDR for the provided resource handle |
static void |
main(String[] args)
The main program for the ToolKit class |
org.nsdl.repository.model.types.Metadata |
newMetadata()
Get a new metadata object |
org.nsdl.repository.model.types.Resource |
newResource()
Get a new resource object |
static void |
prtln(String s)
NOT YET DOCUMENTED |
org.nsdl.repository.model.types.Resource |
putContent(String resourceUrl,
byte[] content,
String label)
Set the provided content into the NDR Resource object having provided resourceUrl |
String |
setResourceContent(org.nsdl.repository.model.types.Resource resource,
byte[] content,
String label)
Sets the resourceContent attribute of the NDRToolkit object |
String |
setResourceContent(org.nsdl.repository.model.types.Resource resource,
byte[] content,
String label,
String mimeType)
Sets the resourceContent attribute of the NDRToolkit object |
String |
setResourceContent(org.nsdl.repository.model.types.Resource resource,
File contentFile)
Sets the resourceContent of the provided resource object |
void |
showConfig()
Output configuration properties to the console. |
String |
uploadFile(File contentFile)
Create new resource, set content to provided file, and return updated resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NDRToolkit()
Method Detail |
---|
public org.nsdl.repository.access.NDRAccess getNdrAccess()
NOTE: AgentHandle and privateKey are NOT required for read operations.
This version gets the ndrAccess WITHOUT USING PROPERTIES FILE, but instead by relying on NDRConstants values ...
public org.nsdl.repository.access.Finder getFinder()
public org.nsdl.repository.model.types.Resource newResource()
public org.nsdl.repository.model.types.Metadata newMetadata()
public org.nsdl.repository.model.types.Resource getResource(String handle) throws Exception
handle
- NOT YET DOCUMENTED
Exception
- if handle is not a Resource or Resource cannot be found for handlepublic org.nsdl.repository.model.types.MetadataProvider getMetadataProvider(String handle) throws Exception
handle
- NOT YET DOCUMENTED
Exception
- if handle is not a MetadataProvider or MetadataProvider cannot be found for handlepublic org.nsdl.repository.model.types.Aggregator getAggregator(String handle) throws Exception
handle
- NOT YET DOCUMENTED
Exception
- if handle is not a Aggregator or Aggregator cannot be found for handlepublic org.nsdl.repository.model.types.Resource findResource(String url) throws Exception
url
- the url
Exception
- NOT YET DOCUMENTEDpublic void showConfig()
public void getAllResources() throws Exception
Exception
- NOT YET DOCUMENTEDpublic void findNsdlOrgAggregators() throws Exception
Exception
public org.nsdl.repository.model.types.Agent getAgent()
public String uploadFile(File contentFile) throws Exception
contentFile
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDpublic static void main(String[] args) throws Exception
args
- The command line arguments
Exception
- NOT YET DOCUMENTEDpublic org.nsdl.repository.model.types.Resource putContent(String resourceUrl, byte[] content, String label) throws Exception
resourceUrl
- NOT YET DOCUMENTEDcontent
- NOT YET DOCUMENTEDlabel
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDpublic String setResourceContent(org.nsdl.repository.model.types.Resource resource, File contentFile) throws Exception
resource
- The new resourceContent valuecontentFile
- The new resourceContent value
Exception
- NOT YET DOCUMENTEDpublic String setResourceContent(org.nsdl.repository.model.types.Resource resource, byte[] content, String label) throws Exception
resource
- The new resourceContent valuecontent
- The new resourceContent valuelabel
- The new resourceContent value
Exception
- NOT YET DOCUMENTEDpublic String setResourceContent(org.nsdl.repository.model.types.Resource resource, byte[] content, String label, String mimeType) throws Exception
resource
- The new resourceContent valuecontent
- The new resourceContent valuelabel
- The new resourceContent valuemimeType
- The new resourceContent value
Exception
- NOT YET DOCUMENTEDpublic static void prtln(String s)
s
- NOT YET DOCUMENTED
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |