public void setTCharArray() throws JIException, InterruptedException, UnknownHostException { System.gc(); JICallBuilder callObject = new JICallBuilder( true); callObject.setOpnum(7); Object results[]; callObject.addInParamAsString("AHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR); results = comObject.call(callObject); }
public void setTCharArray () throws JIException, InterruptedException, UnknownHostException { System.gc (); final JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 7 ); Object results[]; callObject.addInParamAsString ( "AHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); results = this.comObject.call ( callObject ); }
public void setTCharArray() throws JIException, InterruptedException, UnknownHostException { System.gc(); JICallBuilder callObject = new JICallBuilder( true); callObject.setOpnum(7); Object results[]; callObject.addInParamAsString("AHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR); results = comObject.call(callObject); }
public void setClientName ( final String clientName ) throws JIException { JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 4 ); callObject.addInParamAsString ( clientName, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); getCOMObject ().call ( callObject ); }
/** * Rename to group * * @param name * the new name * @throws JIException */ public void setName ( final String name ) throws JIException { final JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 2 ); callObject.addInParamAsString ( name, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); getCOMObject ().call ( callObject ); }
public OPCGroupStateMgt getGroupByName ( final String name ) throws JIException, IllegalArgumentException, UnknownHostException { final JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 2 ); callObject.addInParamAsString ( name, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); callObject.addInParamAsUUID ( Constants.IOPCGroupStateMgt_IID, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL ); final Object[] result = getCOMObject ().call ( callObject ); return new OPCGroupStateMgt ( (IJIComObject)result[0] ); }
/** * Return the possible access paths for an item * @param itemID the item to query * @return A string enumerator for the possible access paths * @throws JIException * @throws IllegalArgumentException * @throws UnknownHostException */ public EnumString browseAccessPaths ( final String itemID ) throws JIException, IllegalArgumentException, UnknownHostException { JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 4 ); callObject.addInParamAsString ( itemID, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL ); Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject ); return new EnumString ( (IJIComObject)result[0] ); }
public void performOp() throws JIException, InterruptedException { JICallBuilder callObject = new JICallBuilder (true); callObject.setOpnum ( 0 ); callObject.addInParamAsString("",JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR); callObject.addInParamAsInt(0xFFFFFFFF, JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 1000,JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 1234,JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer(new Integer(0)), JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer(new Float(0.0)),JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 0, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class,JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class,JIFlags.FLAG_NULL ); callObject.addInParamAsUUID( "39C13A50-011E-11D0-9675-0020AFD8ADB3", JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL ); Object[] result = opcServer.call ( callObject ); JISession.destroySession(unknown.getAssociatedSession()); }
public void performOp () throws JIException, InterruptedException { final JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 0 ); callObject.addInParamAsString ( "", JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); callObject.addInParamAsInt ( 0xFFFFFFFF, JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 1000, JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 1234, JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer ( new Integer ( 0 ) ), JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer ( new Float ( 0.0 ) ), JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 0, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL ); callObject.addInParamAsUUID ( "39C13A50-011E-11D0-9675-0020AFD8ADB3", JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL ); final Object[] result = this.opcServer.call ( callObject ); JISession.destroySession ( this.unknown.getAssociatedSession () ); }
public void performOp() throws JIException, InterruptedException { JICallBuilder callObject = new JICallBuilder (true); callObject.setOpnum ( 0 ); callObject.addInParamAsString("",JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR); callObject.addInParamAsInt(0xFFFFFFFF, JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 1000,JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 1234,JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer(new Integer(0)), JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer(new Float(0.0)),JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( 0, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class,JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class,JIFlags.FLAG_NULL ); callObject.addInParamAsUUID( "39C13A50-011E-11D0-9675-0020AFD8ADB3", JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL ); Object[] result = opcServer.call ( callObject ); JISession.destroySession(unknown.getAssociatedSession()); }
/** * Direct the browser to another position * * Depending on the <em>direction</em> the new position will be set based on the provided * position information. If the direction is {@link OPCBROWSEDIRECTION#OPC_BROWSE_TO} then * the <em>position</em> is the item to go to. If the direction is {@link OPCBROWSEDIRECTION#OPC_BROWSE_DOWN} * the browser will descent into the tree down (not to) the branch item in <em>position</em>. * Passing {@link OPCBROWSEDIRECTION#OPC_BROWSE_UP} won't need a <em>position</em> (pass <code>null</code>) * and will ascent in the tree one level. * * Passing {@link OPCBROWSEDIRECTION#OPC_BROWSE_TO} and <code>null</code> as position will * go to the first root entry of the namespace. * * @param position The item position reference for the direction * @param direction The direction to go based on the position * @throws JIException */ public void changePosition ( final String position, final OPCBROWSEDIRECTION direction ) throws JIException { JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 1 ); callObject.addInParamAsShort ( (short)direction.id (), JIFlags.FLAG_NULL ); callObject.addInParamAsString ( position, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); getCOMObject ().call ( callObject ); }
/** * Clone the group * * @param name * the name of the cloned group * @return The cloned group * @throws JIException * @throws UnknownHostException * @throws IllegalArgumentException */ public OPCGroupStateMgt clone ( final String name ) throws JIException, IllegalArgumentException, UnknownHostException { final JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 3 ); callObject.addInParamAsString ( name, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); callObject.addInParamAsUUID ( Constants.IOPCGroupStateMgt_IID, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL ); final Object[] result = getCOMObject ().call ( callObject ); return new OPCGroupStateMgt ( (IJIComObject)result[0] ); }
public EnumString browse ( final OPCBROWSETYPE browseType, final String filterCriteria, final int accessRights, final int dataType ) throws JIException, IllegalArgumentException, UnknownHostException { JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 2 ); callObject.addInParamAsShort ( (short)browseType.id (), JIFlags.FLAG_NULL ); callObject.addInParamAsString ( filterCriteria, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); callObject.addInParamAsShort ( (short)dataType, JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( accessRights, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL ); Object result[] = Helper.callRespectSFALSE ( getCOMObject (), callObject ); return new EnumString ( (IJIComObject)result[0] ); }
public JIClsid getCLSIDFromProgID ( final String progId ) throws JIException { JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 2 ); callObject.addInParamAsString ( progId, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); callObject.addOutParamAsType ( UUID.class, JIFlags.FLAG_NULL ); try { Object[] result = getCOMObject ().call ( callObject ); return JIClsid.valueOf ( ( (UUID)result[0] ).toString () ); } catch ( JIException e ) { if ( e.getErrorCode () == 0x800401F3 ) { return null; } throw e; } }
/** * Get the complete item id from an item at the local position. * * Browsing a hierarchical namespace the browse method will return items based on the * local level in the namespace. So actually only the last part of the item ID hierarchy * is returned. In order to convert this to the full item ID one can use this method. It * will only work if the browser is still at the position in question. * * @param item the local item * @return the complete item ID * @throws JIException */ public String getItemID ( final String item ) throws JIException { JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 3 ); callObject.addInParamAsString ( item, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); callObject.addOutParamAsObject ( new JIPointer ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ) ), JIFlags.FLAG_NULL ); Object[] result = getCOMObject ().call ( callObject ); return ( (JIString) ( (JIPointer)result[0] ).getReferent () ).getString (); } }
public Object[] findName(JIString nameBuf,int hashValue,short found) throws JIException { JICallBuilder callObject = new JICallBuilder(true); callObject.setOpnum(8); callObject.addInParamAsString((nameBuf).getString(),nameBuf.getType()); callObject.addInParamAsInt(hashValue,JIFlags.FLAG_NULL); callObject.addInParamAsShort(found,JIFlags.FLAG_NULL); callObject.addOutParamAsObject(new JIArray(IJIComObject.class,null,1,true,true),JIFlags.FLAG_NULL); callObject.addOutParamAsObject(new JIArray(Integer.class,null,1,true,true),JIFlags.FLAG_NULL); callObject.addOutParamAsType(Short.class,JIFlags.FLAG_NULL); callObject.addOutParamAsObject(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),JIFlags.FLAG_NULL); return comObject.call(callObject); } }
public Object[] findName(JIString nameBuf,int hashValue,short found) throws JIException { JICallBuilder callObject = new JICallBuilder(true); callObject.setOpnum(8); callObject.addInParamAsString((nameBuf).getString(),nameBuf.getType()); callObject.addInParamAsInt(hashValue,JIFlags.FLAG_NULL); callObject.addInParamAsShort(found,JIFlags.FLAG_NULL); callObject.addOutParamAsObject(new JIArray(IJIComObject.class,null,1,true,true),JIFlags.FLAG_NULL); callObject.addOutParamAsObject(new JIArray(Integer.class,null,1,true,true),JIFlags.FLAG_NULL); callObject.addOutParamAsType(Short.class,JIFlags.FLAG_NULL); callObject.addOutParamAsObject(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),JIFlags.FLAG_NULL); return comObject.call(callObject); } }
@Override public Object[] findName ( final JIString nameBuf, final int hashValue, final short found ) throws JIException { final JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 8 ); callObject.addInParamAsString ( nameBuf.getString (), nameBuf.getType () ); callObject.addInParamAsInt ( hashValue, JIFlags.FLAG_NULL ); callObject.addInParamAsShort ( found, JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIArray ( IJIComObject.class, null, 1, true, true ), JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIArray ( Integer.class, null, 1, true, true ), JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Short.class, JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_BSTR ), JIFlags.FLAG_NULL ); return this.comObject.call ( callObject ); } }
public OPCGroupStateMgt addGroup ( final String name, final boolean active, final int updateRate, final int clientHandle, final Integer timeBias, final Float percentDeadband, final int localeID ) throws JIException, IllegalArgumentException, UnknownHostException { final JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 0 ); callObject.addInParamAsString ( name, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); callObject.addInParamAsInt ( active ? 1 : 0, JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( updateRate, JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( clientHandle, JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer ( timeBias ), JIFlags.FLAG_NULL ); callObject.addInParamAsPointer ( new JIPointer ( percentDeadband ), JIFlags.FLAG_NULL ); callObject.addInParamAsInt ( localeID, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL ); callObject.addInParamAsUUID ( Constants.IOPCGroupStateMgt_IID, JIFlags.FLAG_NULL ); callObject.addOutParamAsType ( IJIComObject.class, JIFlags.FLAG_NULL ); final Object[] result = Helper.callIgnoreSpecificError ( getCOMObject (), callObject, org.openscada.opc.dcom.common.Constants.S_OPC_UNSUPPORTED_UPDATE_RATE ); return new OPCGroupStateMgt ( (IJIComObject)result[2] ); }
public Collection<PropertyDescription> queryAvailableProperties ( final String itemID ) throws JIException { JICallBuilder callObject = new JICallBuilder ( true ); callObject.setOpnum ( 0 ); callObject.addInParamAsString ( itemID, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ); callObject.addOutParamAsType ( Integer.class, JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Integer.class, null, 1, true ) ), JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_BSTR ), null, 1, true ) ), JIFlags.FLAG_NULL ); callObject.addOutParamAsObject ( new JIPointer ( new JIArray ( Short.class, null, 1, true ) ), JIFlags.FLAG_NULL ); Object result[] = getCOMObject ().call ( callObject ); List<PropertyDescription> properties = new LinkedList<PropertyDescription> (); int len = (Integer)result[0]; Integer[] ids = (Integer[]) ( (JIArray) ( (JIPointer)result[1] ).getReferent () ).getArrayInstance (); JIString[] descriptions = (JIString[]) ( (JIArray) ( (JIPointer)result[2] ).getReferent () ).getArrayInstance (); Short[] variableTypes = (Short[]) ( (JIArray) ( (JIPointer)result[3] ).getReferent () ).getArrayInstance (); for ( int i = 0; i < len; i++ ) { PropertyDescription pd = new PropertyDescription (); pd.setId ( ids[i] ); pd.setDescription ( descriptions[i].getString () ); pd.setVarType ( variableTypes[i] ); properties.add ( pd ); } return properties; }