本文整理汇总了Java中es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet类的典型用法代码示例。如果您正苦于以下问题:Java BitmapLabelSet类的具体用法?Java BitmapLabelSet怎么用?Java BitmapLabelSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BitmapLabelSet类属于es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields包,在下文中一共展示了BitmapLabelSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendEROList
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
private static void sendEROList(int numberNodes,String baseIp, String sourceString,String destinationString,int lambda){
sourceString = baseIp +sourceString;
destinationString = baseIp + destinationString;
Inet4Address source=null;
Inet4Address destination=null;
try {
source = (Inet4Address) Inet4Address.getByName(sourceString);
destination=(Inet4Address) Inet4Address.getByName(destinationString);
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
IntraDomainEdge edge=((SimpleTEDB)networkLSPManager.getDomainTEDB()).getNetworkGraph().getEdge(source, destination);
byte[] bytesToChange = createBytesBitmap(((BitmapLabelSet) edge.getTE_info().getAvailableLabels().getLabelSet()).getBytesBitMap(),numberNodes,lambda);
((BitmapLabelSet) edge.getTE_info().getAvailableLabels().getLabelSet()).arraycopyBytesBitMap(bytesToChange);
networkLSPManager.sendMessageOSPF(source, destination);
//FuncionesUtiles.printByte(bytesToChange, "Enviando...",log);
}
示例2: createBitmapLabelSet
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
public static void createBitmapLabelSet(AvailableLabels availableLabels,int numLabels,int grid, int cs,int n){
//FIXME: no hay problema de que se salga el ancho de banda
BitmapLabelSet bitmapLabelSet = new BitmapLabelSet();
DWDMWavelengthLabel dwdmWavelengthLabel = new DWDMWavelengthLabel();
dwdmWavelengthLabel.setGrid(grid);
dwdmWavelengthLabel.setChannelSpacing(cs);
dwdmWavelengthLabel.setN(n);
bitmapLabelSet.setDwdmWavelengthLabel(dwdmWavelengthLabel);
int numberBytes = numLabels/8;
if ((numberBytes*8)<numLabels){
numberBytes++;
}
byte[] bytesBitMap = new byte[numberBytes];
for (int i=0;i<numberBytes;i++)
bytesBitMap[i]=0x00;
bitmapLabelSet.setBytesBitmap(bytesBitMap);
bitmapLabelSet.setNumLabels(numLabels);
availableLabels.setLabelSet(bitmapLabelSet);
}
示例3: setWavelengthReserved
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
public void setWavelengthReserved(int num_wavelength){
if (withWLANs)
{
reservedWLANs[num_wavelength] = true;
}
else
{
int num_byte=num_wavelength/8;
// if ( this.getAvailableLabels()==null){
// PCEServer.log.info("AvailableLabels ES NULL");
//
// }
// if ( this.getAvailableLabels().getLabelSet()==null){
// PCEServer.log.info("AvailableLabels LABEL SET ES NULL");
//
// }
// if (((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitmapReserved()==null){
// PCEServer.log.info("BytesBitmapReserved ES NULL");
//
// }
((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitmapReserved()[num_byte]=(byte)((((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitmapReserved()[num_byte])|(0x80>>>(num_wavelength%8)));
}
}
示例4: setAllWavelengtshUnReserved
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
public void setAllWavelengtshUnReserved(){
if (withWLANs)
{
for (int i = 0; i < reservedWLANs.length; i++)
{
reservedWLANs[i] = false;
}
}
else
{
int num_bytes=((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitmapReserved().length;
for (int i=0;i<num_bytes;++i){
((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitmapReserved()[i]=0x00;
}
}
}
示例5: isWavelengthUnreserved
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
public boolean isWavelengthUnreserved(int num_wavelength){//si es true esta unreserved
if (withWLANs)
{
return (!reservedWLANs[num_wavelength]);
}
else
{
int num_byte=num_wavelength/8;
if (((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitmapReserved()==null){
return false;
}
else{
return ((((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitmapReserved()[num_byte]&(0x80>>>(num_wavelength%8)))==0);
}
}
}
示例6: ModifiedDijkstraSP
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
/**
* Creates and executes a new DijkstraShortestPath algorithm instance. An
* instance is only good for a single search; after construction, it can be
* accessed to retrieve information about the path found.
*
* @param graph the graph to be searched
* @param startVertex the vertex at which the path should start
* @param endVertex the vertex at which the path should end
* @param radius limit on path length, or Double.POSITIVE_INFINITY for
* unbounded search
* @param SetChannels SetChannels
* @param num_slots num_slots
*/
public ModifiedDijkstraSP(SimpleDirectedWeightedGraph<Object,IntraDomainEdge> graph,Object startVertex,Object endVertex, double radius, ArrayList<BitmapLabelSet> SetChannels, int num_slots)
{
if (!graph.containsVertex(endVertex)) {
throw new IllegalArgumentException("graph must contain the end vertex");
}
ClosestFirstIteratorModified<Object,IntraDomainEdge> iter = new ClosestFirstIteratorModified<Object,IntraDomainEdge> (graph, startVertex, radius, SetChannels, this.num_slots);
while (iter.hasNext()) {
Object vertex = iter.next();
if (vertex.equals(endVertex)) {
createEdgeList(graph, iter, startVertex, endVertex);
this.spectrumVertexState=iter.getVertexSpectrumState();
return;
}
}
path = null;
}
示例7: getLambda
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
public static int getLambda(List<IntraDomainEdge> edge_list){
int max_lambdas=((BitmapLabelSet)edge_list.get(0).getTE_info().getAvailableLabels().getLabelSet()).getNumLabels();
int num_bytes=((BitmapLabelSet)edge_list.get(0).getTE_info().getAvailableLabels().getLabelSet()).getBytesBitMap().length;
byte [] bitmap=new byte[num_bytes];
for (int i=0;i<num_bytes;++i){
bitmap[i]=(byte)(((BitmapLabelSet)edge_list.get(0).getTE_info().getAvailableLabels().getLabelSet()).getBytesBitMap()[i]|((BitmapLabelSet)edge_list.get(0).getTE_info().getAvailableLabels().getLabelSet()).getBytesBitmapReserved()[i]);
}
for (int j=1;j<edge_list.size();++j){
for (int i=0;i<num_bytes;++i){
bitmap[i]=(byte)(bitmap[i] | (((BitmapLabelSet)edge_list.get(j).getTE_info().getAvailableLabels().getLabelSet()).getBytesBitMap()[i]|((BitmapLabelSet)edge_list.get(j).getTE_info().getAvailableLabels().getLabelSet()).getBytesBitmapReserved()[i]));
}
}
for (int i=0; i<max_lambdas;++i){
int num_byte=i/8;
if ( (bitmap[num_byte]&(0x80>>>(i%8)))==0){
return i;
}
}
return -1;
}
示例8: notifyWavelengthChange
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
@Override
public void notifyWavelengthChange(Object localInterfaceIPAddress,
Object remoteInterfaceIPAddress,
BitmapLabelSet previousBitmapLabelSet,
BitmapLabelSet newBitmapLabelSet) {
// TODO Auto-generated method stub
}
示例9: setWavelengthOccupied
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
public void setWavelengthOccupied(int num_wavelength)
{
if (withWLANs)
{
occupiedWLANs[num_wavelength] = true;
}
else
{
int num_byte=num_wavelength/8;
((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitMap()[num_byte]=(byte)((((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitMap()[num_byte])|(0x80>>>(num_wavelength%8)));
}
}
示例10: setWavelengthFree
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
public void setWavelengthFree(int num_wavelength)
{
if (withWLANs)
{
occupiedWLANs[num_wavelength] = false;
reservedWLANs[num_wavelength] = false;
}
else
{
int num_byte=num_wavelength/8;
((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitMap()[num_byte]=(byte)(((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitMap()[num_byte]&(0xFFFF7F>>>(num_wavelength%8)));
}
}
示例11: setWavelengthUnReserved
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
public void setWavelengthUnReserved(int num_wavelength){
if (withWLANs)
{
reservedWLANs[num_wavelength] = false;
}
else
{
int num_byte=num_wavelength/8;
((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitmapReserved()[num_byte]=(byte)(((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitmapReserved()[num_byte]&(0xFFFF7F>>>(num_wavelength%8)));
}
}
示例12: isWavelengthFree
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
public boolean isWavelengthFree(int num_wavelength){
if (withWLANs)
{
return (!occupiedWLANs[num_wavelength]);
}
else
{
int num_byte=num_wavelength/8;
return ((((BitmapLabelSet)this.getAvailableLabels().getLabelSet()).getBytesBitMap()[num_byte]&(0x80>>>(num_wavelength%8)))==0);
}
}
示例13: notifyWavelengthChange
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
@Override
public void notifyWavelengthChange(Object localInterfaceIPAddress, Object remoteInterfaceIPAddress, BitmapLabelSet previousBitmapLabelSet, BitmapLabelSet newBitmapLabelSet) {
for (int i=0;i<registeredAlgorithms.size();++i){
registeredAlgorithms.get(i).notifyWavelengthStatusChange(localInterfaceIPAddress, remoteInterfaceIPAddress, previousBitmapLabelSet, newBitmapLabelSet);
}
if (registeredAlgorithms.isEmpty()){
for (int i=0;i<registeredAlgorithmssson.size();++i){
registeredAlgorithmssson.get(i).notifyWavelengthStatusChange(localInterfaceIPAddress, remoteInterfaceIPAddress, previousBitmapLabelSet, newBitmapLabelSet);
}
}
}
示例14: notifyWavelengthChange
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
@Override
public void notifyWavelengthChange(String id,
Object localInterfaceIPAddress, Object remoteInterfaceIPAddress,
BitmapLabelSet previousBitmapLabelSet,
BitmapLabelSet newBitmapLabelSet)
{
TEDB ted = this.ted == null ? teds.get(id) : this.ted;
if (ted instanceof DomainTEDB) {
((DomainTEDB)ted).notifyWavelengthChange(localInterfaceIPAddress, remoteInterfaceIPAddress, previousBitmapLabelSet, newBitmapLabelSet);
}
}
示例15: hasChanged
import es.tid.ospf.ospfv2.lsa.tlv.subtlv.complexFields.BitmapLabelSet; //导入依赖的package包/类
public boolean hasChanged(LabelSetField LabelTEinfo ,LabelSetField LabelTElink){
byte[] bytesBitMapTEinfo = (((BitmapLabelSet)LabelTEinfo).getBytesBitMap());
byte[] bytesBitMapTElink = ((BitmapLabelSet)LabelTElink).getBytesBitMap();
//FIXME: mirar que pasa si la lonmgitud no es la misma
//Si la longitud no es la misma, significa que hay balanceo de carga
//Entonces tengo que coger los bytes de LabelTElink que quiero, para ello necesito la 'n'
//del base label de la topologia del PCE
if (bytesBitMapTEinfo.length != bytesBitMapTElink.length){
int nMin=((SimpleTEDB)TEDB).getWSONinfo().getnMin();
int numLambdas=((SimpleTEDB)TEDB).getWSONinfo().getNumLambdas();
int numberBytes = getNumberBytes(numLambdas);
byte[] newBytes = new byte[bytesBitMapTElink.length];
System.arraycopy(bytesBitMapTElink, nMin, newBytes, 0,numberBytes);
for (int i =0; i<bytesBitMapTEinfo.length;i++){
if (bytesBitMapTEinfo[i] != newBytes[i])
return true;
}
}
else if (lambdaEnd!=Integer.MAX_VALUE){
/*El PCE esta actuando sobre un rango de lambdas determinado*/
for (int i =getNumberBytes(lambdaIni); i<getNumberBytes(lambdaEnd);i++){
if (bytesBitMapTEinfo[i] != bytesBitMapTElink[i])
return true;
}
}
else{
for (int i =0; i<bytesBitMapTEinfo.length;i++){
if (bytesBitMapTEinfo[i] != bytesBitMapTElink[i])
return true;
}
}
return false;
}