retrieve available storages via JavaApi - orientdb

is it possible to retrieve available storage(s) when working with plocal:[dbPath] connection?
db = new ODatabaseDocumentTx("plocal:[path]");
db.?
Thank you.

You can use:
Collection<OStorage> storages = Orient.instance().getStorages();
It retrieves all the opened storages. To get the name call .getName() against the storage instance.

Related

Add non-standard segments with nhapi

My system has to generate an xml in which the node ORM_O01.ORDER_DETAIL must contain the node ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP, because it has to communicate with Mirth.
I am using the nhapi library version 2.5, in which this node does not contain it.
var obr = _ormO01Message.GetORDER().ORDER_DETAIL.OBR;
obr.SetIDOBR.Value = "1";
obr.PlacerOrderNumber.EntityIdentifier.Value = "123456";
obr.PlacerOrderNumber.NamespaceID.Value = "6543";
obr.PlacerOrderNumber.UniversalID.Value = "10009";
obr.UniversalServiceIdentifier.Identifier.Value = "NS";
Is it possible to add a node in ORM_O01.ORDER_DETAIL that is not standard?
Thanks.
<ORM_O01.ORDER_DETAIL>
<ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP>
<OBR>
<OBR.1>1</OBR.1>
<OBR.2>
<EI.1>123456</EI.1>
<EI.2>6543</EI.2>
<EI.3>10009</EI.3>
</OBR.2>
<OBR.4>
<CE.1>NS</CE.1>
</OBR.4>
</OBR>
</ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP>
</ORM_O01.ORDER_DETAIL>
ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP looks like it actually is standard for 2.5, but neither nhapi or hapi (which mirth uses) include it. I wouldn't worry about trying to add it in because mirth probably wouldn't be able to parse it if you did.
See similar issue where a mirth user needed to strip that group out.

Dynamic sqlWorkflowInstanceStore

I have created an application using this
http://msdn.microsoft.com/en-us/magazine/ff646977.aspx
What i need to do is callWorkflow instances store dynamically
i.e before
string message = "";
string result = client.EvaluateMortgage();
I should be able to specify the sqlworkflowinstancestore i.e where the workflow data is
Any help will be appreciated.
I think you can do like this,
SqlWorkflowInstanceStore store = new SqlWorkflowInstanceStore(connectionString);
More info
Here you can find several ways of configuring /using it

Oracle UCM - ridc - get all versions of document

I am getting files from Oracle UCM via RIDC. I am using DataBinder as follows :
IdcClient client =getUCMConnection();
DataBinder dataBinder = client.createBinder ();
dataBinder.putLocal ("IdcService", "GET_FILE");
dataBinder.putLocal ("dID", dID);
IdcContext userContext = new IdcContext(username);
ServiceResponse response = client.sendRequest (userContext, dataBinder);
InputStream fstream = response.getResponseStream ();
....... etc.
I want to ask, how can I get "ALL VERSIONS" of a document instead of latest released one?
First you have to call the service DOC_INFO, you can get the result set of the revision by using the REVISION_HISTORY set.
You will get specific dID for each version, you iterate them and use GET_FILE with dID as a parameter for each one of them
I can't test it right now but I think the service you are looking for is GET_INFO, try it and check all the resultsets you get I'm pretty sure one of them has the info for all the document's revisions.
You can use the service REV_HISTORY to get the result set REVISIONS which contains info of all the revisions.

MongoDB : How to find if slaveOk=true is set or not

We are using Mongo DB in our Application .
We have one primary and one secondary for this purpose .
How can i make sure that my Application is reading data from Primary Or Secondary ??
My question is how can i know if slaveOk=true is set or not ??
Thanks in advance .
Edited Part
Not sure of the Driver what i am uisng
I am connecting Mongo DB through Java as shown
ServerAddress addr = new ServerAddress(new InetSocketAddress(host, port));
servAddrList.add(addr);
}
MongoOptions options = new MongoOptions();
options.autoConnectRetry = true;
options.connectionsPerHost = Config.intParam(
"mongo.connectionsPerHost", 1200);
mongo = new Mongo("10.11.13.111", 27017);
And i am using mongo 2.4.jar
Please let m know how can i find what driver i am using ??
What are you looking for in my opinion is readPreference : http://docs.mongodb.org/manual/applications/replication/#replica-set-read-preference
In the api (http://api.mongodb.org/java/2.10.1/com/mongodb/ReadPreference.html) documentation there is an isSlaveOk() method : http://api.mongodb.org/java/2.10.1/com/mongodb/ReadPreference.html#isSlaveOk()
See this question: How to perform read operations from primary only
There is the answer for setting read preference
mongo.setReadPreference(ReadPreference.primary());
and your answer is to get read preference:
mongo.getReadPreference().isSlaveOk();
Unfortunately these features do not exist in versions after 2.4.
looks like earlier java driver just have mongo.slaveOk() method, call it and it is slaveOk. no way to examine.

retrieving the default outlook email account using Redemption

just trying to work my way around using Redemption; I've got the following code to retrieve the RDOAccounts (Email accounts) from the default Profile:
Profiles profiles = (Profiles)Activator.CreateInstance(Type.GetTypeFromProgID("ProfMan.Profiles"));
Profile defaultProfile = profiles.DefaultProfile;
//open a RDOSession for this profile
RDOSession session = RedemptionLoader.new_RDOSession();
session.Logon(defaultProfile.Name);
RDOAccounts accounts = session.Accounts;
Where I'm stuck is trying to determine which of the RDOAccount objects is set as the default email account - there doesn't seem to be any property on the object that I can use to see whether it's the default or not.
Anyone done this before?
Use RDOSession.Accounts collection, in particular RDOAccounts.GetOrder method: http://www.dimastr.com/redemption/RDOAccounts.htm
I think this works - but if anyone's got a more elegant solution I'd love to hear it!
RDOAccount defaultAccount = session.GetDefaultFolder(rdoDefaultFolders.olFolderInbox).Store.StoreAccount;
Use RDOSession.Accounts collection, in particular RDOAccounts.GetOrder method.