_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q9900
StatementManager.getNonKeyValues
train
protected ValueContainer[] getNonKeyValues(PersistenceBroker broker, ClassDescriptor cld, Object obj) throws PersistenceBrokerException { return broker.serviceBrokerHelper().getNonKeyRwValues(cld, obj); }
java
{ "resource": "" }
q9901
StatementManager.bindProcedure
train
private void bindProcedure(PreparedStatement stmt, ClassDescriptor cld, Object obj, ProcedureDescriptor proc) throws SQLException { int valueSub = 0; // Figure out if we are using a callable statement. If we are, then we // will need to register one or more output parameters. CallableStatement callable = null; try { callable = (CallableStatement) stmt; } catch(Exception e) { m_log.error("Error while bind values for class '" + (cld != null ? cld.getClassNameOfObject() : null) + "', using stored procedure: "+ proc, e); if(e instanceof SQLException) { throw (SQLException) e; } else { throw new PersistenceBrokerException("Unexpected error while bind values for class '" + (cld != null ? cld.getClassNameOfObject() : null) + "', using stored procedure: "+ proc); } } // If we have a return value, then register it. if ((proc.hasReturnValue()) && (callable != null)) { int jdbcType = proc.getReturnValueFieldRef().getJdbcType().getType(); m_platform.setNullForStatement(stmt, valueSub + 1, jdbcType); callable.registerOutParameter(valueSub + 1, jdbcType); valueSub++; } // Process all of the arguments. Iterator iterator = proc.getArguments().iterator(); while (iterator.hasNext()) { ArgumentDescriptor arg = (ArgumentDescriptor) iterator.next(); Object val = arg.getValue(obj); int jdbcType = arg.getJdbcType(); setObjectForStatement(stmt, valueSub + 1, val, jdbcType); if ((arg.getIsReturnedByProcedure()) && (callable != null)) { callable.registerOutParameter(valueSub + 1, jdbcType); } valueSub++; } }
java
{ "resource": "" }
q9902
StatementManager.setObjectForStatement
train
private void setObjectForStatement(PreparedStatement stmt, int index, Object value, int sqlType) throws SQLException { if (value == null) { m_platform.setNullForStatement(stmt, index, sqlType); } else { m_platform.setObjectForStatement(stmt, index, value, sqlType); } }
java
{ "resource": "" }
q9903
ObjectCacheTwoLevelImpl.remove
train
public void remove(Identity oid) { if(log.isDebugEnabled()) log.debug("Remove object " + oid); sessionCache.remove(oid); getApplicationCache().remove(oid); }
java
{ "resource": "" }
q9904
ObjectCacheTwoLevelImpl.putToSessionCache
train
private void putToSessionCache(Identity oid, CacheEntry entry, boolean onlyIfNew) { if(onlyIfNew) { // no synchronization needed, because session cache was used per broker instance if(!sessionCache.containsKey(oid)) sessionCache.put(oid, entry); } else { sessionCache.put(oid, entry); } }
java
{ "resource": "" }
q9905
ObjectCacheTwoLevelImpl.processQueue
train
private void processQueue() { CacheEntry sv; while((sv = (CacheEntry) queue.poll()) != null) { sessionCache.remove(sv.oid); } }
java
{ "resource": "" }
q9906
ObjectCacheTwoLevelImpl.beforeClose
train
public void beforeClose(PBStateEvent event) { /* arminw: this is a workaround for use in managed environments. When a PB instance is used within a container a PB.close call is done when leave the container method. This close the PB handle (but the real instance is still in use) and the PB listener are notified. But the JTA tx was not committed at this point in time and the session cache should not be cleared, because the updated/new objects will be pushed to the real cache on commit call (if we clear, nothing to push). So we check if the real broker is in a local tx (in this case we are in a JTA tx and the handle is closed), if true we don't reset the session cache. */ if(!broker.isInTransaction()) { if(log.isDebugEnabled()) log.debug("Clearing the session cache"); resetSessionCache(); } }
java
{ "resource": "" }
q9907
VersionsHandler.isUpToDate
train
public boolean isUpToDate(final DbArtifact artifact) { final List<String> versions = repoHandler.getArtifactVersions(artifact); final String currentVersion = artifact.getVersion(); final String lastDevVersion = getLastVersion(versions); final String lastReleaseVersion = getLastRelease(versions); if(lastDevVersion == null || lastReleaseVersion == null) { // Plain Text comparison against version "strings" for(final String version: versions){ if(version.compareTo(currentVersion) > 0){ return false; } } return true; } else { return currentVersion.equals(lastDevVersion) || currentVersion.equals(lastReleaseVersion); } }
java
{ "resource": "" }
q9908
RowReaderDefaultImpl.buildOrRefreshObject
train
protected Object buildOrRefreshObject(Map row, ClassDescriptor targetClassDescriptor, Object targetObject) { Object result = targetObject; FieldDescriptor fmd; FieldDescriptor[] fields = targetClassDescriptor.getFieldDescriptor(true); if(targetObject == null) { // 1. create new object instance if needed result = ClassHelper.buildNewObjectInstance(targetClassDescriptor); } // 2. fill all scalar attributes of the new object for (int i = 0; i < fields.length; i++) { fmd = fields[i]; fmd.getPersistentField().set(result, row.get(fmd.getColumnName())); } if(targetObject == null) { // 3. for new build objects, invoke the initialization method for the class if one is provided Method initializationMethod = targetClassDescriptor.getInitializationMethod(); if (initializationMethod != null) { try { initializationMethod.invoke(result, NO_ARGS); } catch (Exception ex) { throw new PersistenceBrokerException("Unable to invoke initialization method:" + initializationMethod.getName() + " for class:" + m_cld.getClassOfObject(), ex); } } } return result; }
java
{ "resource": "" }
q9909
RowReaderDefaultImpl.selectClassDescriptor
train
protected ClassDescriptor selectClassDescriptor(Map row) throws PersistenceBrokerException { ClassDescriptor result = m_cld; Class ojbConcreteClass = (Class) row.get(OJB_CONCRETE_CLASS_KEY); if(ojbConcreteClass != null) { result = m_cld.getRepository().getDescriptorFor(ojbConcreteClass); // if we can't find class-descriptor for concrete class, something wrong with mapping if (result == null) { throw new PersistenceBrokerException("Can't find class-descriptor for ojbConcreteClass '" + ojbConcreteClass + "', the main class was " + m_cld.getClassNameOfObject()); } } return result; }
java
{ "resource": "" }
q9910
ConfigurationAbstractImpl.load
train
protected void load() { properties = new Properties(); String filename = getFilename(); try { URL url = ClassHelper.getResource(filename); if (url == null) { url = (new File(filename)).toURL(); } logger.info("Loading OJB's properties: " + url); URLConnection conn = url.openConnection(); conn.setUseCaches(false); conn.connect(); InputStream strIn = conn.getInputStream(); properties.load(strIn); strIn.close(); } catch (FileNotFoundException ex) { // [tomdz] If the filename is explicitly reset (null or empty string) then we'll // output an info message because the user did this on purpose // Otherwise, we'll output a warning if ((filename == null) || (filename.length() == 0)) { logger.info("Starting OJB without a properties file. OJB is using default settings instead."); } else { logger.warn("Could not load properties file '"+filename+"'. Using default settings!", ex); } // [tomdz] There seems to be no use of this setting ? //properties.put("valid", "false"); } catch (Exception ex) { throw new MetadataException("An error happend while loading the properties file '"+filename+"'", ex); } }
java
{ "resource": "" }
q9911
ReportsRegistry.init
train
public static void init() { reports.clear(); Reflections reflections = new Reflections(REPORTS_PACKAGE); final Set<Class<? extends Report>> reportClasses = reflections.getSubTypesOf(Report.class); for(Class<? extends Report> c : reportClasses) { LOG.info("Report class: " + c.getName()); try { reports.add(c.newInstance()); } catch (IllegalAccessException | InstantiationException e) { LOG.error("Error while loading report implementation classes", e); } } if(LOG.isInfoEnabled()) { LOG.info(String.format("Detected %s reports", reports.size())); } }
java
{ "resource": "" }
q9912
UrlContentTilePainter.paint
train
public InternalTile paint(InternalTile tile) throws RenderException { if (tile.getContentType().equals(VectorTileContentType.URL_CONTENT)) { if (urlBuilder != null) { if (paintGeometries) { urlBuilder.paintGeometries(paintGeometries); urlBuilder.paintLabels(false); tile.setFeatureContent(urlBuilder.getImageUrl()); } if (paintLabels) { urlBuilder.paintGeometries(false); urlBuilder.paintLabels(paintLabels); tile.setLabelContent(urlBuilder.getImageUrl()); } return tile; } } return tile; }
java
{ "resource": "" }
q9913
EditableTreeNodeWithProperties.addPropertyChangeListener
train
public void addPropertyChangeListener (String propertyName, java.beans.PropertyChangeListener listener) { this.propertyChangeDelegate.addPropertyChangeListener(propertyName, listener); }
java
{ "resource": "" }
q9914
EditableTreeNodeWithProperties.removePropertyChangeListener
train
public void removePropertyChangeListener (String propertyName, java.beans.PropertyChangeListener listener) { this.propertyChangeDelegate.removePropertyChangeListener(propertyName, listener); }
java
{ "resource": "" }
q9915
EditableTreeNodeWithProperties.setAttribute
train
public void setAttribute(String strKey, Object value) { this.propertyChangeDelegate.firePropertyChange(strKey, hmAttributes.put(strKey, value), value); }
java
{ "resource": "" }
q9916
ListenerMockAgent.modifyBeliefCount
train
private void modifyBeliefCount(int count){ introspector.setBeliefValue(getLocalName(), Definitions.RECEIVED_MESSAGE_COUNT, getBeliefCount()+count, null); }
java
{ "resource": "" }
q9917
ListenerMockAgent.getBeliefCount
train
private int getBeliefCount() { Integer count = (Integer)introspector.getBeliefBase(ListenerMockAgent.this).get(Definitions.RECEIVED_MESSAGE_COUNT); if (count == null) count = 0; // Just in case, not really sure if this is necessary. return count; }
java
{ "resource": "" }
q9918
ReportingController.addParameters
train
@SuppressWarnings("unchecked") private void addParameters(Model model, HttpServletRequest request) { for (Object objectEntry : request.getParameterMap().entrySet()) { Map.Entry<String, String[]> entry = (Map.Entry<String, String[]>) objectEntry; String key = entry.getKey(); String[] values = entry.getValue(); if (null != values && values.length > 0) { String value = values[0]; try { model.addAttribute(key, getParameter(key, value)); } catch (ParseException pe) { log.error("Could not parse parameter value {} for {}, ignoring parameter.", key, value); } catch (NumberFormatException nfe) { log.error("Could not parse parameter value {} for {}, ignoring parameter.", key, value); } } } }
java
{ "resource": "" }
q9919
ReportingController.getParameter
train
private Object getParameter(String name, String value) throws ParseException, NumberFormatException { Object result = null; if (name.length() > 0) { switch (name.charAt(0)) { case 'i': if (null == value || value.length() == 0) { value = "0"; } result = new Integer(value); break; case 'f': if (name.startsWith("form")) { result = value; } else { if (null == value || value.length() == 0) { value = "0.0"; } result = new Double(value); } break; case 'd': if (null == value || value.length() == 0) { result = null; } else { SimpleDateFormat dateParser = new SimpleDateFormat("yyyy-MM-dd"); result = dateParser.parse(value); } break; case 't': if (null == value || value.length() == 0) { result = null; } else { SimpleDateFormat timeParser = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); result = timeParser.parse(value); } break; case 'b': result = "true".equalsIgnoreCase(value) ? Boolean.TRUE : Boolean.FALSE; break; default: result = value; } if (log.isDebugEnabled()) { if (result != null) { log.debug( "parameter " + name + " value " + result + " class " + result.getClass().getName()); } else { log.debug("parameter" + name + "is null"); } } } return result; }
java
{ "resource": "" }
q9920
SqlGeneratorDefaultImpl.getPreparedDeleteStatement
train
public SqlStatement getPreparedDeleteStatement(ClassDescriptor cld) { SqlForClass sfc = getSqlForClass(cld); SqlStatement sql = sfc.getDeleteSql(); if(sql == null) { ProcedureDescriptor pd = cld.getDeleteProcedure(); if(pd == null) { sql = new SqlDeleteByPkStatement(cld, logger); } else { sql = new SqlProcedureStatement(pd, logger); } // set the sql string sfc.setDeleteSql(sql); if(logger.isDebugEnabled()) { logger.debug("SQL:" + sql.getStatement()); } } return sql; }
java
{ "resource": "" }
q9921
SqlGeneratorDefaultImpl.getPreparedInsertStatement
train
public SqlStatement getPreparedInsertStatement(ClassDescriptor cld) { SqlStatement sql; SqlForClass sfc = getSqlForClass(cld); sql = sfc.getInsertSql(); if(sql == null) { ProcedureDescriptor pd = cld.getInsertProcedure(); if(pd == null) { sql = new SqlInsertStatement(cld, logger); } else { sql = new SqlProcedureStatement(pd, logger); } // set the sql string sfc.setInsertSql(sql); if(logger.isDebugEnabled()) { logger.debug("SQL:" + sql.getStatement()); } } return sql; }
java
{ "resource": "" }
q9922
SqlGeneratorDefaultImpl.getPreparedSelectByPkStatement
train
public SelectStatement getPreparedSelectByPkStatement(ClassDescriptor cld) { SelectStatement sql; SqlForClass sfc = getSqlForClass(cld); sql = sfc.getSelectByPKSql(); if(sql == null) { sql = new SqlSelectByPkStatement(m_platform, cld, logger); // set the sql string sfc.setSelectByPKSql(sql); if(logger.isDebugEnabled()) { logger.debug("SQL:" + sql.getStatement()); } } return sql; }
java
{ "resource": "" }
q9923
SqlGeneratorDefaultImpl.getPreparedSelectStatement
train
public SelectStatement getPreparedSelectStatement(Query query, ClassDescriptor cld) { SelectStatement sql = new SqlSelectStatement(m_platform, cld, query, logger); if (logger.isDebugEnabled()) { logger.debug("SQL:" + sql.getStatement()); } return sql; }
java
{ "resource": "" }
q9924
SqlGeneratorDefaultImpl.getPreparedUpdateStatement
train
public SqlStatement getPreparedUpdateStatement(ClassDescriptor cld) { SqlForClass sfc = getSqlForClass(cld); SqlStatement result = sfc.getUpdateSql(); if(result == null) { ProcedureDescriptor pd = cld.getUpdateProcedure(); if(pd == null) { result = new SqlUpdateStatement(cld, logger); } else { result = new SqlProcedureStatement(pd, logger); } // set the sql string sfc.setUpdateSql(result); if(logger.isDebugEnabled()) { logger.debug("SQL:" + result.getStatement()); } } return result; }
java
{ "resource": "" }
q9925
SqlGeneratorDefaultImpl.toSQLClause
train
private String toSQLClause(FieldCriteria c, ClassDescriptor cld) { String colName = toSqlClause(c.getAttribute(), cld); return colName + c.getClause() + c.getValue(); }
java
{ "resource": "" }
q9926
SqlGeneratorDefaultImpl.getPreparedDeleteStatement
train
public SqlStatement getPreparedDeleteStatement(Query query, ClassDescriptor cld) { return new SqlDeleteByQuery(m_platform, cld, query, logger); }
java
{ "resource": "" }
q9927
ConcreteEditingContext.hasBidirectionalAssociation
train
private boolean hasBidirectionalAssociation(Class clazz) { ClassDescriptor cdesc; Collection refs; boolean hasBidirAssc; if (_withoutBidirAssc.contains(clazz)) { return false; } if (_withBidirAssc.contains(clazz)) { return true; } // first time we meet this class, let's look at metadata cdesc = _pb.getClassDescriptor(clazz); refs = cdesc.getObjectReferenceDescriptors(); hasBidirAssc = false; REFS_CYCLE: for (Iterator it = refs.iterator(); it.hasNext(); ) { ObjectReferenceDescriptor ord; ClassDescriptor relCDesc; Collection relRefs; ord = (ObjectReferenceDescriptor) it.next(); relCDesc = _pb.getClassDescriptor(ord.getItemClass()); relRefs = relCDesc.getObjectReferenceDescriptors(); for (Iterator relIt = relRefs.iterator(); relIt.hasNext(); ) { ObjectReferenceDescriptor relOrd; relOrd = (ObjectReferenceDescriptor) relIt.next(); if (relOrd.getItemClass().equals(clazz)) { hasBidirAssc = true; break REFS_CYCLE; } } } if (hasBidirAssc) { _withBidirAssc.add(clazz); } else { _withoutBidirAssc.add(clazz); } return hasBidirAssc; }
java
{ "resource": "" }
q9928
ConcreteEditingContext.handleDependentReferences
train
private ArrayList handleDependentReferences(Identity oid, Object userObject, Object[] origFields, Object[] newFields, Object[] newRefs) throws LockingException { ClassDescriptor mif = _pb.getClassDescriptor(userObject.getClass()); FieldDescriptor[] fieldDescs = mif.getFieldDescriptions(); Collection refDescs = mif.getObjectReferenceDescriptors(); int count = 1 + fieldDescs.length; ArrayList newObjects = new ArrayList(); int countRefs = 0; for (Iterator it = refDescs.iterator(); it.hasNext(); count++, countRefs++) { ObjectReferenceDescriptor rds = (ObjectReferenceDescriptor) it.next(); Identity origOid = (origFields == null ? null : (Identity) origFields[count]); Identity newOid = (Identity) newFields[count]; if (rds.getOtmDependent()) { if ((origOid == null) && (newOid != null)) { ContextEntry entry = (ContextEntry) _objects.get(newOid); if (entry == null) { Object relObj = newRefs[countRefs]; insertInternal(newOid, relObj, LockType.WRITE_LOCK, true, oid, new Stack()); newObjects.add(newOid); } } else if ((origOid != null) && ((newOid == null) || !newOid.equals(origOid))) { markDelete(origOid, oid, false); } } } return newObjects; }
java
{ "resource": "" }
q9929
ConcreteEditingContext.handleDependentCollections
train
private ArrayList handleDependentCollections(Identity oid, Object obj, Object[] origCollections, Object[] newCollections, Object[] newCollectionsOfObjects) throws LockingException { ClassDescriptor mif = _pb.getClassDescriptor(obj.getClass()); Collection colDescs = mif.getCollectionDescriptors(); ArrayList newObjects = new ArrayList(); int count = 0; for (Iterator it = colDescs.iterator(); it.hasNext(); count++) { CollectionDescriptor cds = (CollectionDescriptor) it.next(); if (cds.getOtmDependent()) { ArrayList origList = (origCollections == null ? null : (ArrayList) origCollections[count]); ArrayList newList = (ArrayList) newCollections[count]; if (origList != null) { for (Iterator it2 = origList.iterator(); it2.hasNext(); ) { Identity origOid = (Identity) it2.next(); if ((newList == null) || !newList.contains(origOid)) { markDelete(origOid, oid, true); } } } if (newList != null) { int countElem = 0; for (Iterator it2 = newList.iterator(); it2.hasNext(); countElem++) { Identity newOid = (Identity) it2.next(); if ((origList == null) || !origList.contains(newOid)) { ContextEntry entry = (ContextEntry) _objects.get(newOid); if (entry == null) { ArrayList relCol = (ArrayList) newCollectionsOfObjects[count]; Object relObj = relCol.get(countElem); insertInternal(newOid, relObj, LockType.WRITE_LOCK, true, null, new Stack()); newObjects.add(newOid); } } } } } } return newObjects; }
java
{ "resource": "" }
q9930
ReconfigurableClassPathApplicationContext.refresh
train
public void refresh(String[] configLocations) throws GeomajasException { try { setConfigLocations(configLocations); refresh(); } catch (Exception e) { throw new GeomajasException(e, ExceptionCode.REFRESH_CONFIGURATION_FAILED); } }
java
{ "resource": "" }
q9931
ReconfigurableClassPathApplicationContext.rollback
train
public void rollback() throws GeomajasException { try { setConfigLocations(previousConfigLocations); refresh(); } catch (Exception e) { throw new GeomajasException(e, ExceptionCode.REFRESH_CONFIGURATION_FAILED); } }
java
{ "resource": "" }
q9932
GrapesServerConfig.getUrl
train
public String getUrl(){ final StringBuilder sb = new StringBuilder(); sb.append("http://"); sb.append(getHttpConfiguration().getBindHost().get()); sb.append(":"); sb.append(getHttpConfiguration().getPort()); return sb.toString(); }
java
{ "resource": "" }
q9933
Table.addRow
train
public void addRow(final String... cells){ final Row row = new Row((Object[]) cells); if(!rows.contains(row)){ rows.add(row); } }
java
{ "resource": "" }
q9934
SequenceManagerHelper.firstFoundTableName
train
private static String firstFoundTableName(PersistenceBroker brokerForClass, ClassDescriptor cld) { String name = null; if (!cld.isInterface() && cld.getFullTableName() != null) { return cld.getFullTableName(); } if (cld.isExtent()) { Collection extentClasses = cld.getExtentClasses(); for (Iterator iterator = extentClasses.iterator(); iterator.hasNext();) { name = firstFoundTableName(brokerForClass, brokerForClass.getClassDescriptor((Class) iterator.next())); // System.out.println("## " + cld.getClassNameOfObject()+" - name: "+name); if (name != null) break; } } return name; }
java
{ "resource": "" }
q9935
SequenceManagerHelper.getMaxId
train
public static long getMaxId(PersistenceBroker brokerForClass, Class topLevel, FieldDescriptor original) throws PersistenceBrokerException { long max = 0; long tmp; ClassDescriptor cld = brokerForClass.getClassDescriptor(topLevel); // if class is not an interface / not abstract we have to search its directly mapped table if (!cld.isInterface() && !cld.isAbstract()) { tmp = getMaxIdForClass(brokerForClass, cld, original); if (tmp > max) { max = tmp; } } // if class is an extent we have to search through its subclasses if (cld.isExtent()) { Vector extentClasses = cld.getExtentClasses(); for (int i = 0; i < extentClasses.size(); i++) { Class extentClass = (Class) extentClasses.get(i); if (cld.getClassOfObject().equals(extentClass)) { throw new PersistenceBrokerException("Circular extent in " + extentClass + ", please check the repository"); } else { // fix by Mark Rowell // Call recursive tmp = getMaxId(brokerForClass, extentClass, original); } if (tmp > max) { max = tmp; } } } return max; }
java
{ "resource": "" }
q9936
SequenceManagerHelper.getMaxIdForClass
train
public static long getMaxIdForClass( PersistenceBroker brokerForClass, ClassDescriptor cldForOriginalOrExtent, FieldDescriptor original) throws PersistenceBrokerException { FieldDescriptor field = null; if (!original.getClassDescriptor().equals(cldForOriginalOrExtent)) { // check if extent match not the same table if (!original.getClassDescriptor().getFullTableName().equals( cldForOriginalOrExtent.getFullTableName())) { // we have to look for id's in extent class table field = cldForOriginalOrExtent.getFieldDescriptorByName(original.getAttributeName()); } } else { field = original; } if (field == null) { // if null skip this call return 0; } String column = field.getColumnName(); long result = 0; ResultSet rs = null; Statement stmt = null; StatementManagerIF sm = brokerForClass.serviceStatementManager(); String table = cldForOriginalOrExtent.getFullTableName(); // String column = cld.getFieldDescriptorByName(fieldName).getColumnName(); String sql = SM_SELECT_MAX + column + SM_FROM + table; try { //lookup max id for the current class stmt = sm.getGenericStatement(cldForOriginalOrExtent, Query.NOT_SCROLLABLE); rs = stmt.executeQuery(sql); rs.next(); result = rs.getLong(1); } catch (Exception e) { log.warn("Cannot lookup max value from table " + table + " for column " + column + ", PB was " + brokerForClass + ", using jdbc-descriptor " + brokerForClass.serviceConnectionManager().getConnectionDescriptor(), e); } finally { try { sm.closeResources(stmt, rs); } catch (Exception ignore) { // ignore it } } return result; }
java
{ "resource": "" }
q9937
Identity.fromByteArray
train
public static Identity fromByteArray(final byte[] anArray) throws PersistenceBrokerException { // reverse of the serialize() algorithm: // read from byte[] with a ByteArrayInputStream, decompress with // a GZIPInputStream and then deserialize by reading from the ObjectInputStream try { final ByteArrayInputStream bais = new ByteArrayInputStream(anArray); final GZIPInputStream gis = new GZIPInputStream(bais); final ObjectInputStream ois = new ObjectInputStream(gis); final Identity result = (Identity) ois.readObject(); ois.close(); gis.close(); bais.close(); return result; } catch (Exception ex) { throw new PersistenceBrokerException(ex); } }
java
{ "resource": "" }
q9938
Identity.serialize
train
public byte[] serialize() throws PersistenceBrokerException { // Identity is serialized and written to an ObjectOutputStream // This ObjectOutputstream is compressed by a GZIPOutputStream // and finally written to a ByteArrayOutputStream. // the resulting byte[] is returned try { final ByteArrayOutputStream bao = new ByteArrayOutputStream(); final GZIPOutputStream gos = new GZIPOutputStream(bao); final ObjectOutputStream oos = new ObjectOutputStream(gos); oos.writeObject(this); oos.close(); gos.close(); bao.close(); return bao.toByteArray(); } catch (Exception ignored) { throw new PersistenceBrokerException(ignored); } }
java
{ "resource": "" }
q9939
Identity.checkForPrimaryKeys
train
protected void checkForPrimaryKeys(final Object realObject) throws ClassNotPersistenceCapableException { // if no PKs are specified OJB can't handle this class ! if (m_pkValues == null || m_pkValues.length == 0) { throw createException("OJB needs at least one primary key attribute for class: ", realObject, null); } // arminw: should never happen // if(m_pkValues[0] instanceof ValueContainer) // throw new OJBRuntimeException("Can't handle pk values of type "+ValueContainer.class.getName()); }
java
{ "resource": "" }
q9940
TmsConfigurationService.getCapabilities
train
public TileMap getCapabilities(TmsLayer layer) throws TmsLayerException { try { // Create a JaxB unmarshaller: JAXBContext context = JAXBContext.newInstance(TileMap.class); Unmarshaller um = context.createUnmarshaller(); // Find out where to retrieve the capabilities and unmarshall: if (layer.getBaseTmsUrl().startsWith(CLASSPATH)) { String location = layer.getBaseTmsUrl().substring(CLASSPATH.length()); if (location.length() > 0 && location.charAt(0) == '/') { // classpath resources should not start with a slash, but they often do location = location.substring(1); } ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (null == cl) { cl = getClass().getClassLoader(); // NOSONAR fallback from proper behaviour for some environments } InputStream is = cl.getResourceAsStream(location); if (null != is) { try { return (TileMap) um.unmarshal(is); } finally { try { is.close(); } catch (IOException ioe) { // ignore, just closing the stream } } } throw new TmsLayerException(TmsLayerException.COULD_NOT_FIND_FILE, layer.getBaseTmsUrl()); } // Normal case, find the URL and unmarshal: return (TileMap) um.unmarshal(httpService.getStream(layer.getBaseTmsUrl(), layer)); } catch (JAXBException e) { throw new TmsLayerException(e, TmsLayerException.COULD_NOT_READ_FILE, layer.getBaseTmsUrl()); } catch (IOException e) { throw new TmsLayerException(e, TmsLayerException.COULD_NOT_READ_FILE, layer.getBaseTmsUrl()); } }
java
{ "resource": "" }
q9941
TmsConfigurationService.asLayerInfo
train
public RasterLayerInfo asLayerInfo(TileMap tileMap) { RasterLayerInfo layerInfo = new RasterLayerInfo(); layerInfo.setCrs(tileMap.getSrs()); layerInfo.setDataSourceName(tileMap.getTitle()); layerInfo.setLayerType(LayerType.RASTER); layerInfo.setMaxExtent(asBbox(tileMap.getBoundingBox())); layerInfo.setTileHeight(tileMap.getTileFormat().getHeight()); layerInfo.setTileWidth(tileMap.getTileFormat().getWidth()); List<ScaleInfo> zoomLevels = new ArrayList<ScaleInfo>(tileMap.getTileSets().getTileSets().size()); for (TileSet tileSet : tileMap.getTileSets().getTileSets()) { zoomLevels.add(asScaleInfo(tileSet)); } layerInfo.setZoomLevels(zoomLevels); return layerInfo; }
java
{ "resource": "" }
q9942
ReportQueryRsIterator.init_jdbcTypes
train
private void init_jdbcTypes() throws SQLException { ReportQuery q = (ReportQuery) getQueryObject().getQuery(); m_jdbcTypes = new int[m_attributeCount]; // try to get jdbcTypes from Query if (q.getJdbcTypes() != null) { m_jdbcTypes = q.getJdbcTypes(); } else { ResultSetMetaData rsMetaData = getRsAndStmt().m_rs.getMetaData(); for (int i = 0; i < m_attributeCount; i++) { m_jdbcTypes[i] = rsMetaData.getColumnType(i + 1); } } }
java
{ "resource": "" }
q9943
RepositoryVerifierHandler.getLiteralId
train
private int getLiteralId(String literal) throws PersistenceBrokerException { ////logger.debug("lookup: " + literal); try { return tags.getIdByTag(literal); } catch (NullPointerException t) { throw new MetadataException("unknown literal: '" + literal + "'",t); } }
java
{ "resource": "" }
q9944
ProcedureDescriptor.hasReturnValues
train
public final boolean hasReturnValues() { if (this.hasReturnValue()) { return true; } else { // TODO: We may be able to 'pre-calculate' the results // of this loop by just checking arguments as they are added // The only problem is that the 'isReturnedbyProcedure' property // can be modified once the argument is added to this procedure. // If that occurs, then 'pre-calculated' results will be inacccurate. Iterator iter = this.getArguments().iterator(); while (iter.hasNext()) { ArgumentDescriptor arg = (ArgumentDescriptor) iter.next(); if (arg.getIsReturnedByProcedure()) { return true; } } } return false; }
java
{ "resource": "" }
q9945
ProcedureDescriptor.addArguments
train
protected void addArguments(FieldDescriptor field[]) { for (int i = 0; i < field.length; i++) { ArgumentDescriptor arg = new ArgumentDescriptor(this); arg.setValue(field[i].getAttributeName(), false); this.addArgument(arg); } }
java
{ "resource": "" }
q9946
LdapAuthenticationService.setNamedRoles
train
@Api public void setNamedRoles(Map<String, List<NamedRoleInfo>> namedRoles) { this.namedRoles = namedRoles; ldapRoleMapping = new HashMap<String, Set<String>>(); for (String roleName : namedRoles.keySet()) { if (!ldapRoleMapping.containsKey(roleName)) { ldapRoleMapping.put(roleName, new HashSet<String>()); } for (NamedRoleInfo role : namedRoles.get(roleName)) { ldapRoleMapping.get(roleName).add(role.getName()); } } }
java
{ "resource": "" }
q9947
ScaleInfo.setPixelPerUnit
train
public void setPixelPerUnit(double pixelPerUnit) { if (pixelPerUnit < MINIMUM_PIXEL_PER_UNIT) { pixelPerUnit = MINIMUM_PIXEL_PER_UNIT; } if (pixelPerUnit > MAXIMUM_PIXEL_PER_UNIT) { pixelPerUnit = MAXIMUM_PIXEL_PER_UNIT; } this.pixelPerUnit = pixelPerUnit; setPixelPerUnitBased(true); postConstruct(); }
java
{ "resource": "" }
q9948
ScaleInfo.postConstruct
train
@PostConstruct protected void postConstruct() { if (pixelPerUnitBased) { // Calculate numerator and denominator if (pixelPerUnit > PIXEL_PER_METER) { this.numerator = pixelPerUnit / conversionFactor; this.denominator = 1; } else { this.numerator = 1; this.denominator = PIXEL_PER_METER / pixelPerUnit; } setPixelPerUnitBased(false); } else { // Calculate PPU this.pixelPerUnit = numerator / denominator * conversionFactor; setPixelPerUnitBased(true); } }
java
{ "resource": "" }
q9949
BatchConnection.nextExecuted
train
void nextExecuted(String sql) throws SQLException { count++; if (_order.contains(sql)) { return; } String sqlCmd = sql.substring(0, 7); String rest = sql.substring(sqlCmd.equals("UPDATE ") ? 7 // "UPDATE " : 12); // "INSERT INTO " or "DELETE FROM " String tableName = rest.substring(0, rest.indexOf(' ')); HashSet fkTables = (HashSet) _fkInfo.get(tableName); // we should not change order of INSERT/DELETE/UPDATE // statements for the same table if (_touched.contains(tableName)) { executeBatch(); } if (sqlCmd.equals("INSERT ")) { if (_dontInsert != null && _dontInsert.contains(tableName)) { // one of the previous INSERTs contained a table // that references this table. // Let's execute that previous INSERT right now so that // in the future INSERTs into this table will go first // in the _order array. executeBatch(); } } else //if (sqlCmd.equals("DELETE ") || sqlCmd.equals("UPDATE ")) { // We process UPDATEs in the same way as DELETEs // because setting FK to NULL in UPDATE is equivalent // to DELETE from the referential integrity point of view. if (_deleted != null && fkTables != null) { HashSet intersection = (HashSet) _deleted.clone(); intersection.retainAll(fkTables); if (!intersection.isEmpty()) { // one of the previous DELETEs contained a table // that is referenced from this table. // Let's execute that previous DELETE right now so that // in the future DELETEs into this table will go first // in the _order array. executeBatch(); } } } _order.add(sql); _touched.add(tableName); if (sqlCmd.equals("INSERT ")) { if (fkTables != null) { if (_dontInsert == null) { _dontInsert = new HashSet(); } _dontInsert.addAll(fkTables); } } else if (sqlCmd.equals("DELETE ")) { if (_deleted == null) { _deleted = new HashSet(); } _deleted.add(tableName); } }
java
{ "resource": "" }
q9950
BatchConnection.prepareBatchStatement
train
private PreparedStatement prepareBatchStatement(String sql) { String sqlCmd = sql.substring(0, 7); if (sqlCmd.equals("UPDATE ") || sqlCmd.equals("DELETE ") || (_useBatchInserts && sqlCmd.equals("INSERT "))) { PreparedStatement stmt = (PreparedStatement) _statements.get(sql); if (stmt == null) { // [olegnitz] for JDK 1.2 we need to list both PreparedStatement and Statement // interfaces, otherwise proxy.jar works incorrectly stmt = (PreparedStatement) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{ PreparedStatement.class, Statement.class, BatchPreparedStatement.class}, new PreparedStatementInvocationHandler(this, sql, m_jcd)); _statements.put(sql, stmt); } return stmt; } else { return null; } }
java
{ "resource": "" }
q9951
SystemReader.generateJavaFiles
train
public static void generateJavaFiles(String requirementsFolder, String platformName, String src_test_dir, String tests_package, String casemanager_package, String loggingPropFile) throws Exception { File reqFolder = new File(requirementsFolder); if (reqFolder.isDirectory()) { for (File f : reqFolder.listFiles()) { if (f.getName().endsWith(".story")) { try { SystemReader.generateJavaFilesForOneStory( f.getCanonicalPath(), platformName, src_test_dir, tests_package, casemanager_package, loggingPropFile); } catch (IOException e) { String message = "ERROR: " + e.getMessage(); logger.severe(message); throw new BeastException(message, e); } } } for (File f : reqFolder.listFiles()) { if (f.isDirectory()) { SystemReader.generateJavaFiles(requirementsFolder + File.separator + f.getName(), platformName, src_test_dir, tests_package + "." + f.getName(), casemanager_package, loggingPropFile); } } } else if (reqFolder.getName().endsWith(".story")) { SystemReader.generateJavaFilesForOneStory(requirementsFolder, platformName, src_test_dir, tests_package, casemanager_package, loggingPropFile); } else { String message = "No story file found in " + requirementsFolder; logger.severe(message); throw new BeastException(message); } }
java
{ "resource": "" }
q9952
Module.setPromoted
train
public void setPromoted(final boolean promoted) { this.promoted = promoted; for (final Artifact artifact : artifacts) { artifact.setPromoted(promoted); } for (final Module suModule : submodules) { suModule.setPromoted(promoted); } }
java
{ "resource": "" }
q9953
Module.addDependency
train
public void addDependency(final Dependency dependency) { if(dependency != null && !dependencies.contains(dependency)){ this.dependencies.add(dependency); } }
java
{ "resource": "" }
q9954
Module.addSubmodule
train
public void addSubmodule(final Module submodule) { if (!submodules.contains(submodule)) { submodule.setSubmodule(true); if (promoted) { submodule.setPromoted(promoted); } submodules.add(submodule); } }
java
{ "resource": "" }
q9955
Module.addArtifact
train
public void addArtifact(final Artifact artifact) { if (!artifacts.contains(artifact)) { if (promoted) { artifact.setPromoted(promoted); } artifacts.add(artifact); } }
java
{ "resource": "" }
q9956
Messages.get
train
public static String get(MessageKey key) { return data.getProperty(key.toString(), key.toString()); }
java
{ "resource": "" }
q9957
Messages.loadFile
train
private static void loadFile(String filePath) { final Path path = FileSystems.getDefault().getPath(filePath); try { data.clear(); data.load(Files.newBufferedReader(path)); } catch(IOException e) { LOG.warn("Exception while loading " + path.toString(), e); } }
java
{ "resource": "" }
q9958
ArgumentDescriptor.setValue
train
public void setValue(String constantValue) { this.fieldSource = SOURCE_VALUE; this.fieldRefName = null; this.returnedByProcedure = false; this.constantValue = constantValue; }
java
{ "resource": "" }
q9959
ArgumentDescriptor.getJdbcType
train
public final int getJdbcType() { switch (this.fieldSource) { case SOURCE_FIELD : return this.getFieldRef().getJdbcType().getType(); case SOURCE_NULL : return java.sql.Types.NULL; case SOURCE_VALUE : return java.sql.Types.VARCHAR; default : return java.sql.Types.NULL; } }
java
{ "resource": "" }
q9960
GetFeaturesEachCachingInterceptor.isCacheable
train
private boolean isCacheable(PipelineContext context) throws GeomajasException { VectorLayer layer = context.get(PipelineCode.LAYER_KEY, VectorLayer.class); return !(layer instanceof VectorLayerLazyFeatureConversionSupport && ((VectorLayerLazyFeatureConversionSupport) layer).useLazyFeatureConversion()); }
java
{ "resource": "" }
q9961
RasterLayerInfo.getResolutions
train
@Deprecated public List<Double> getResolutions() { List<Double> resolutions = new ArrayList<Double>(); for (ScaleInfo scale : getZoomLevels()) { resolutions.add(1. / scale.getPixelPerUnit()); } return resolutions; }
java
{ "resource": "" }
q9962
RasterLayerInfo.setResolutions
train
@Deprecated public void setResolutions(List<Double> resolutions) { getZoomLevels().clear(); for (Double resolution : resolutions) { getZoomLevels().add(new ScaleInfo(1. / resolution)); } }
java
{ "resource": "" }
q9963
JerseyResponseSupport.registerTinyTypes
train
public static void registerTinyTypes(Class<?> head, Class<?>... tail) { final Set<HeaderDelegateProvider> systemRegisteredHeaderProviders = stealAcquireRefToHeaderDelegateProviders(); register(head, systemRegisteredHeaderProviders); for (Class<?> tt : tail) { register(tt, systemRegisteredHeaderProviders); } }
java
{ "resource": "" }
q9964
JongoUtils.generateQuery
train
public static String generateQuery(final Map<String,Object> params){ final StringBuilder sb = new StringBuilder(); boolean newEntry = false; sb.append("{"); for(final Entry<String,Object> param: params.entrySet()){ if(newEntry){ sb.append(", "); } sb.append(param.getKey()); sb.append(": "); sb.append(getParam(param.getValue())); newEntry = true; } sb.append("}"); return sb.toString(); }
java
{ "resource": "" }
q9965
JongoUtils.generateQuery
train
public static String generateQuery(final String key, final Object value) { final Map<String, Object> params = new HashMap<>(); params.put(key, value); return generateQuery(params); }
java
{ "resource": "" }
q9966
JongoUtils.getParam
train
private static Object getParam(final Object param) { final StringBuilder sb = new StringBuilder(); if(param instanceof String){ sb.append("'"); sb.append((String)param); sb.append("'"); } else if(param instanceof Boolean){ sb.append(String.valueOf((Boolean)param)); } else if(param instanceof Integer){ sb.append(String.valueOf((Integer)param)); } else if(param instanceof DBRegExp){ sb.append('/'); sb.append(((DBRegExp) param).toString()); sb.append('/'); } return sb.toString(); }
java
{ "resource": "" }
q9967
SqlHelper.getOjbClassName
train
public static String getOjbClassName(ResultSet rs) { try { return rs.getString(OJB_CLASS_COLUMN); } catch (SQLException e) { return null; } }
java
{ "resource": "" }
q9968
QueryImpl.setOjbQuery
train
public void setOjbQuery(org.apache.ojb.broker.query.Query ojbQuery) { this.ojbQuery = ojbQuery; }
java
{ "resource": "" }
q9969
OrganizationResource.getCorporateGroupIdPrefix
train
@GET @Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON}) @Path("/{name}" + ServerAPI.GET_CORPORATE_GROUPIDS) public Response getCorporateGroupIdPrefix(@PathParam("name") final String organizationId){ LOG.info("Got a get corporate groupId prefix request for organization " + organizationId +"."); final ListView view = new ListView("Organization " + organizationId, "Corporate GroupId Prefix"); final List<String> corporateGroupIds = getOrganizationHandler().getCorporateGroupIds(organizationId); view.addAll(corporateGroupIds); return Response.ok(view).build(); }
java
{ "resource": "" }
q9970
OrganizationResource.addCorporateGroupIdPrefix
train
@POST @Path("/{name}" + ServerAPI.GET_CORPORATE_GROUPIDS) public Response addCorporateGroupIdPrefix(@Auth final DbCredential credential, @PathParam("name") final String organizationId, final String corporateGroupId){ LOG.info("Got an add a corporate groupId prefix request for organization " + organizationId +"."); if(!credential.getRoles().contains(DbCredential.AvailableRoles.DATA_UPDATER)){ throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build()); } if(corporateGroupId == null || corporateGroupId.isEmpty()){ LOG.error("No corporate GroupId to add!"); throw new WebApplicationException(Response.serverError().status(HttpStatus.BAD_REQUEST_400) .entity("CorporateGroupId to add should be in the query content.").build()); } getOrganizationHandler().addCorporateGroupId(organizationId, corporateGroupId); return Response.ok().status(HttpStatus.CREATED_201).build(); }
java
{ "resource": "" }
q9971
OrganizationResource.removeCorporateGroupIdPrefix
train
@DELETE @Path("/{name}" + ServerAPI.GET_CORPORATE_GROUPIDS) public Response removeCorporateGroupIdPrefix(@Auth final DbCredential credential, @PathParam("name") final String organizationId, final String corporateGroupId){ LOG.info("Got an remove a corporate groupId prefix request for organization " + organizationId +"."); if(!credential.getRoles().contains(DbCredential.AvailableRoles.DATA_UPDATER)){ throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build()); } if(corporateGroupId == null || corporateGroupId.isEmpty()){ LOG.error("No corporate GroupId to remove!"); return Response.serverError().status(HttpStatus.BAD_REQUEST_400).build(); } getOrganizationHandler().removeCorporateGroupId(organizationId, corporateGroupId); return Response.ok("done").build(); }
java
{ "resource": "" }
q9972
GetFeaturesEachStep.findStyleFilter
train
private StyleFilter findStyleFilter(Object feature, List<StyleFilter> styles) { for (StyleFilter styleFilter : styles) { if (styleFilter.getFilter().evaluate(feature)) { return styleFilter; } } return new StyleFilterImpl(); }
java
{ "resource": "" }
q9973
AbstractRoller.roll
train
final void roll(final long timeForSuffix) { final File backupFile = this.prepareBackupFile(timeForSuffix); // close filename this.getAppender().closeFile(); // rename filename on disk to filename+suffix(+number) this.doFileRoll(this.getAppender().getIoFile(), backupFile); // setup new file 'filename' this.getAppender().openFile(); this.fireFileRollEvent(new FileRollEvent(this, backupFile)); }
java
{ "resource": "" }
q9974
AbstractRoller.doFileRoll
train
private void doFileRoll(final File from, final File to) { final FileHelper fileHelper = FileHelper.getInstance(); if (!fileHelper.deleteExisting(to)) { this.getAppender().getErrorHandler() .error("Unable to delete existing " + to + " for rename"); } final String original = from.toString(); if (fileHelper.rename(from, to)) { LogLog.debug("Renamed " + original + " to " + to); } else { this.getAppender().getErrorHandler() .error("Unable to rename " + original + " to " + to); } }
java
{ "resource": "" }
q9975
spilloverpolicy_lbvserver_binding.get
train
public static spilloverpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{ spilloverpolicy_lbvserver_binding obj = new spilloverpolicy_lbvserver_binding(); obj.set_name(name); spilloverpolicy_lbvserver_binding response[] = (spilloverpolicy_lbvserver_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q9976
appfwprofile_excluderescontenttype_binding.get
train
public static appfwprofile_excluderescontenttype_binding[] get(nitro_service service, String name) throws Exception{ appfwprofile_excluderescontenttype_binding obj = new appfwprofile_excluderescontenttype_binding(); obj.set_name(name); appfwprofile_excluderescontenttype_binding response[] = (appfwprofile_excluderescontenttype_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q9977
sslparameter.update
train
public static base_response update(nitro_service client, sslparameter resource) throws Exception { sslparameter updateresource = new sslparameter(); updateresource.quantumsize = resource.quantumsize; updateresource.crlmemorysizemb = resource.crlmemorysizemb; updateresource.strictcachecks = resource.strictcachecks; updateresource.ssltriggertimeout = resource.ssltriggertimeout; updateresource.sendclosenotify = resource.sendclosenotify; updateresource.encrypttriggerpktcount = resource.encrypttriggerpktcount; updateresource.denysslreneg = resource.denysslreneg; updateresource.insertionencoding = resource.insertionencoding; updateresource.ocspcachesize = resource.ocspcachesize; updateresource.pushflag = resource.pushflag; updateresource.dropreqwithnohostheader = resource.dropreqwithnohostheader; updateresource.pushenctriggertimeout = resource.pushenctriggertimeout; updateresource.undefactioncontrol = resource.undefactioncontrol; updateresource.undefactiondata = resource.undefactiondata; return updateresource.update_resource(client); }
java
{ "resource": "" }
q9978
sslparameter.unset
train
public static base_response unset(nitro_service client, sslparameter resource, String[] args) throws Exception{ sslparameter unsetresource = new sslparameter(); return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q9979
sslparameter.get
train
public static sslparameter get(nitro_service service) throws Exception{ sslparameter obj = new sslparameter(); sslparameter[] response = (sslparameter[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q9980
spilloverpolicy.add
train
public static base_response add(nitro_service client, spilloverpolicy resource) throws Exception { spilloverpolicy addresource = new spilloverpolicy(); addresource.name = resource.name; addresource.rule = resource.rule; addresource.action = resource.action; addresource.comment = resource.comment; return addresource.add_resource(client); }
java
{ "resource": "" }
q9981
spilloverpolicy.update
train
public static base_response update(nitro_service client, spilloverpolicy resource) throws Exception { spilloverpolicy updateresource = new spilloverpolicy(); updateresource.name = resource.name; updateresource.rule = resource.rule; updateresource.action = resource.action; updateresource.comment = resource.comment; return updateresource.update_resource(client); }
java
{ "resource": "" }
q9982
spilloverpolicy.get
train
public static spilloverpolicy[] get(nitro_service service, options option) throws Exception{ spilloverpolicy obj = new spilloverpolicy(); spilloverpolicy[] response = (spilloverpolicy[])obj.get_resources(service,option); return response; }
java
{ "resource": "" }
q9983
spilloverpolicy.get
train
public static spilloverpolicy get(nitro_service service, String name) throws Exception{ spilloverpolicy obj = new spilloverpolicy(); obj.set_name(name); spilloverpolicy response = (spilloverpolicy) obj.get_resource(service); return response; }
java
{ "resource": "" }
q9984
PaddedList.valueOf
train
public static <IN> PaddedList<IN> valueOf(List<IN> list, IN padding) { return new PaddedList<IN>(list, padding); }
java
{ "resource": "" }
q9985
locationfile.add
train
public static base_response add(nitro_service client, locationfile resource) throws Exception { locationfile addresource = new locationfile(); addresource.Locationfile = resource.Locationfile; addresource.format = resource.format; return addresource.add_resource(client); }
java
{ "resource": "" }
q9986
locationfile.delete
train
public static base_response delete(nitro_service client) throws Exception { locationfile deleteresource = new locationfile(); return deleteresource.delete_resource(client); }
java
{ "resource": "" }
q9987
locationfile.get
train
public static locationfile get(nitro_service service) throws Exception{ locationfile obj = new locationfile(); locationfile[] response = (locationfile[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q9988
sslcertkey_sslocspresponder_binding.get
train
public static sslcertkey_sslocspresponder_binding[] get(nitro_service service, String certkey) throws Exception{ sslcertkey_sslocspresponder_binding obj = new sslcertkey_sslocspresponder_binding(); obj.set_certkey(certkey); sslcertkey_sslocspresponder_binding response[] = (sslcertkey_sslocspresponder_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q9989
appflowpolicy_appflowpolicylabel_binding.get
train
public static appflowpolicy_appflowpolicylabel_binding[] get(nitro_service service, String name) throws Exception{ appflowpolicy_appflowpolicylabel_binding obj = new appflowpolicy_appflowpolicylabel_binding(); obj.set_name(name); appflowpolicy_appflowpolicylabel_binding response[] = (appflowpolicy_appflowpolicylabel_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q9990
authenticationvserver_authenticationnegotiatepolicy_binding.get
train
public static authenticationvserver_authenticationnegotiatepolicy_binding[] get(nitro_service service, String name) throws Exception{ authenticationvserver_authenticationnegotiatepolicy_binding obj = new authenticationvserver_authenticationnegotiatepolicy_binding(); obj.set_name(name); authenticationvserver_authenticationnegotiatepolicy_binding response[] = (authenticationvserver_authenticationnegotiatepolicy_binding[]) obj.get_resources(service); return response; }
java
{ "resource": "" }
q9991
rnatparam.update
train
public static base_response update(nitro_service client, rnatparam resource) throws Exception { rnatparam updateresource = new rnatparam(); updateresource.tcpproxy = resource.tcpproxy; return updateresource.update_resource(client); }
java
{ "resource": "" }
q9992
rnatparam.unset
train
public static base_response unset(nitro_service client, rnatparam resource, String[] args) throws Exception{ rnatparam unsetresource = new rnatparam(); return unsetresource.unset_resource(client,args); }
java
{ "resource": "" }
q9993
rnatparam.get
train
public static rnatparam get(nitro_service service) throws Exception{ rnatparam obj = new rnatparam(); rnatparam[] response = (rnatparam[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }
q9994
nd6ravariables.update
train
public static base_response update(nitro_service client, nd6ravariables resource) throws Exception { nd6ravariables updateresource = new nd6ravariables(); updateresource.vlan = resource.vlan; updateresource.ceaserouteradv = resource.ceaserouteradv; updateresource.sendrouteradv = resource.sendrouteradv; updateresource.srclinklayeraddroption = resource.srclinklayeraddroption; updateresource.onlyunicastrtadvresponse = resource.onlyunicastrtadvresponse; updateresource.managedaddrconfig = resource.managedaddrconfig; updateresource.otheraddrconfig = resource.otheraddrconfig; updateresource.currhoplimit = resource.currhoplimit; updateresource.maxrtadvinterval = resource.maxrtadvinterval; updateresource.minrtadvinterval = resource.minrtadvinterval; updateresource.linkmtu = resource.linkmtu; updateresource.reachabletime = resource.reachabletime; updateresource.retranstime = resource.retranstime; updateresource.defaultlifetime = resource.defaultlifetime; return updateresource.update_resource(client); }
java
{ "resource": "" }
q9995
nd6ravariables.update
train
public static base_responses update(nitro_service client, nd6ravariables resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { nd6ravariables updateresources[] = new nd6ravariables[resources.length]; for (int i=0;i<resources.length;i++){ updateresources[i] = new nd6ravariables(); updateresources[i].vlan = resources[i].vlan; updateresources[i].ceaserouteradv = resources[i].ceaserouteradv; updateresources[i].sendrouteradv = resources[i].sendrouteradv; updateresources[i].srclinklayeraddroption = resources[i].srclinklayeraddroption; updateresources[i].onlyunicastrtadvresponse = resources[i].onlyunicastrtadvresponse; updateresources[i].managedaddrconfig = resources[i].managedaddrconfig; updateresources[i].otheraddrconfig = resources[i].otheraddrconfig; updateresources[i].currhoplimit = resources[i].currhoplimit; updateresources[i].maxrtadvinterval = resources[i].maxrtadvinterval; updateresources[i].minrtadvinterval = resources[i].minrtadvinterval; updateresources[i].linkmtu = resources[i].linkmtu; updateresources[i].reachabletime = resources[i].reachabletime; updateresources[i].retranstime = resources[i].retranstime; updateresources[i].defaultlifetime = resources[i].defaultlifetime; } result = update_bulk_request(client, updateresources); } return result; }
java
{ "resource": "" }
q9996
nd6ravariables.get
train
public static nd6ravariables[] get(nitro_service service, options option) throws Exception{ nd6ravariables obj = new nd6ravariables(); nd6ravariables[] response = (nd6ravariables[])obj.get_resources(service,option); return response; }
java
{ "resource": "" }
q9997
nd6ravariables.get
train
public static nd6ravariables get(nitro_service service, Long vlan) throws Exception{ nd6ravariables obj = new nd6ravariables(); obj.set_vlan(vlan); nd6ravariables response = (nd6ravariables) obj.get_resource(service); return response; }
java
{ "resource": "" }
q9998
nd6ravariables.get
train
public static nd6ravariables[] get(nitro_service service, Long vlan[]) throws Exception{ if (vlan !=null && vlan.length>0) { nd6ravariables response[] = new nd6ravariables[vlan.length]; nd6ravariables obj[] = new nd6ravariables[vlan.length]; for (int i=0;i<vlan.length;i++) { obj[i] = new nd6ravariables(); obj[i].set_vlan(vlan[i]); response[i] = (nd6ravariables) obj[i].get_resource(service); } return response; } return null; }
java
{ "resource": "" }
q9999
gslbrunningconfig.get
train
public static gslbrunningconfig get(nitro_service service) throws Exception{ gslbrunningconfig obj = new gslbrunningconfig(); gslbrunningconfig[] response = (gslbrunningconfig[])obj.get_resources(service); return response[0]; }
java
{ "resource": "" }